Legacy GM Need help with depth control or Z axis for player and enemy



I am trying to make a building with depth. like when player or enemy goes through stairs they will reach top and when they are in top they will not able to fall down or collide with object with 0 depth.

see the picture below.

+2 is next top
+1 is first floor or top of the building
0 depth is ground. Player and enemy will collide with building or walls
-1 down floor

I still don't understand Z depth and seeking help from you guys. need help with codes. if you can provide me code i will be happy and will be thankful for your help :D

isometric building.png


Do you know how to work with x? Do you know how to work with y? Then you know how to work with z, kinda. You can't use built-in collision functions as normal, though.

[/code]with parent_object_for_all_interactives
if z == other.z
if place_meeting(x,y,other.id)
//you collided

As for how to implement stairs, it kind of depends on how your stairs are actually set up.