How do I specify layers with persistant objects?

E

Ethan Uffelman

Guest
I'm trying to make a persistent object, but whenever I go to the next room, the object is created under another object. I can't seem to specify the depth, and I can't specify the layer in the room it's going to since it's not in the room when I edit it. I'm sorry I sound dumb, I've only been using game maker for a few months and I'm trying to learn from experiencing things, and I would only come to the forums when I have no other option.
 
C

CedSharp

Guest
From the documentation:


In other words, inside the "Room Start" event, you have the ability to change layer/depth of your object programatically.
Hopefully that is what you were looking for!
 
E

Ethan Uffelman

Guest
I'm really sorry, I should've specified earlier. I'm working with DnD, so I don't think I can just add a string which specifies the depth. If I can, please let me know! But is there a way to specify the depth in DnD?
 
S

spoonsinbunnies

Guest
in the old gamemaker there is a dnd event called set variable, Not sure if or where to find it in game maker studios2 if you choose to set depth it should work.
 
C

CedSharp

Guest
Yup that worked! Thanks!
Can you please let me know if your object appears in the correct layer? Or is it random?

If I'm not wrong, your object cannot change it's depth based on objects of other layers.
Each layer has it's own "depth management".

Glad it worked with just setting a variable tho!
 
E

Ethan Uffelman

Guest
I'm not completely sure, but I set the depth to some extremely small variable, since there's nothing it's going behind in my game
 
Top