[SOLVED] Creation code sets depth of object, how do I keep it the same when I change object?

F

Frotagonist

Guest
Example. I have a bunch of trees that are the same object in my room and when the room starts, they each have their own creation code that sets the depth. Now I want to make it so that when I press a button, all those trees will turn into a different color tree, but still have the same depth. I tried changing the object to the new color tree object and also tried just changing the sprite, but the depth gets reset and everything looks messy.

EDIT: Sorry, I should clarify that I meant the creation code for the object in the room (Its ID). Not the create code in the object editor
 
Last edited by a moderator:
D

Darren

Guest
Can't you just make the depth of the object you are changing into the same as the original tree, or parent them both to something with the depth you want?

Alternatively, change the sprite not the object, and it'll remain the same.

EDIT: And use the "depth" feature above parent, rather than the create event, because it sounds like you're changing to something, bypassing the create event, and then it doesn't know what depth to set..
 
F

Frotagonist

Guest
Can't you just make the depth of the object you are changing into the same as the original tree, or parent them both to something with the depth you want?

Alternatively, change the sprite not the object, and it'll remain the same.

EDIT: And use the "depth" feature above parent, rather than the create event, because it sounds like you're changing to something, bypassing the create event, and then it doesn't know what depth to set..
Doesn't seem to work. I only have one 2 tree objects. One green, one orange. I just place multiple of them in the room and use the scaling tool so it looks like I have a lot in different sizes.

EDIT: Sorry, I should clarify that I meant the creation code for the object in the room. Not in the object editor
 
Top