wipeout2185
Member
What's is the best way to deal with layers and persistent objects in GMS2? I've found when moving a persistent object to a new room it's layer don't follow. My solution in testing has been to find a suitable new layer, moving the object in the room start event.
The objects in question for me are just controller objects and don't do any drawing. Would it be bad practice to just not re-assign the object to a new layer?
I was also thinking of just using instance create depth for any controller objects as these are sort of layer independent. Downside to this being I know create depth is mainly for backwards compatibility and comes with a slight overhead.
Any thoughts?
Update 16/03/19:
It's not a bug the reason it looks like the instances on the "Instances" layer in room0 aren't being carried across to room1 is because they are being recreated at their original depth of 100, and the background in room1 draws over the top of them (as it is also at depth 100). If you set the background depth in room1 to 200 then all instances show up fine.
The objects in question for me are just controller objects and don't do any drawing. Would it be bad practice to just not re-assign the object to a new layer?
I was also thinking of just using instance create depth for any controller objects as these are sort of layer independent. Downside to this being I know create depth is mainly for backwards compatibility and comes with a slight overhead.
Any thoughts?
Update 16/03/19:
It's not a bug the reason it looks like the instances on the "Instances" layer in room0 aren't being carried across to room1 is because they are being recreated at their original depth of 100, and the background in room1 draws over the top of them (as it is also at depth 100). If you set the background depth in room1 to 200 then all instances show up fine.
Last edited: