Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(2 edits)

Hey, I tried using the code you mentioned, and for some reason it results in anything i place higher than the first layer actually being LOWER

i made a new room and put in the CONTROL object and a floor and a couple of walls on the first instances layer, then made a new one on top with a few walls, and for some reason all those walls are actually lower than the things on the bottom layer

this even seems to happen even if everything is on the same layer, with the walls always being below where they should be for some reason (just to a lesser extent)

(1 edit)

I messed around a bit and got very weird results, after a while I think I figured it out. There's some legacy shenanigans going on with the depth values, so you need to explicitly read them from the layers. This version of the code seems to work as intended:

z = -64*(layer_get_depth(layer) div 100)

But you also need to do two more things:

  • CONTROL currently changes its depth value in the create event, cut this line and paste it in the Room Start event (otherwise it gets an extreme depth value which in turn messes up where the player spawns on the Z axis)
  • Likewise, all of the "floor" objects sets their depth to 0 in the create event, remove this entirely.