• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Creating an object on top of another object?

D

Daeldalus

Guest
I have a grid of objects that i need to be able to place another object directly on top of any of them.
I have tried instance_create and it does nothing.
I have tried setting the objects to different depths and nothing.
I have tried using the DnD commands and using direct code and neither do anything.
even when i click outside the grid of objects.

what am i missing?
 
D

Daeldalus

Guest
I figured it out partly
I have to set object depth inside the object creator menu.

but changing depth inside the creation code does nothing still
 

Lite

Member
Are you stuck just getting the object to show on top of the other object or do you need help getting it to create another object on top of itself? Depth should be working to show one object on top of another as long as the bottom object has a higher depth, make sure the object on top is farther negative than the bottom.
 
D

Daeldalus

Guest
it is a little of both problems.

i could create an object, then slide it under another object and no amount of coding would ever get it to show on top of the first object.

also i would set depths correctly in code but when i go to create this new object on top of another object, the code for creating the object
would not even run. I checked that with multiple debugging messages and none of them would show.

but all the same code works correctly after i set depths inside the object's DnD menu. except for the code to change depths while the game
is running. nothing i do gets objects to swap places in depth dynamically.
 
L

Laurent57

Guest
I suppose you need some conditions to change depth while the game is running. Are these conditions ok?
In which event do you change depth while the game is running ?
 
D

Daeldalus

Guest
I have tried changing the the depth at game start and at room creation.
during each step event.
at object create
on mouse click
each time a button is pressed.
none of these even causes the code to get to the debug message.

it might be that it wasn't even allowing the second object to create
since the beginning depth was the same as the other object.
but I tried changing the depth at game start and it still would not create
the object even thought the depths should have been different at that time
 
Top