• 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!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code Depth and Layers in GMS:2

I

Ice Guy

Guest
GameMaker 2 overhauled and improved the layering and depth system. At the moment I can't get my head around the new system. I've read the manual regarding how the new layers work and how its more efficient, but I just can't seem to get the objects and tiles in my room to draw in the correct order and depth.

I've got a foreground and background layer for tiles that should go infront and behind the player, and that works fine. But my problem is with other objects like enemies in the room. They're all on the same layer, but how do I make them draw similarly to depth = -y, whilst still maintaining the depth of the tiles and having the depth change for individual objects? All the new depth/layer functions seem to break one way or another. Help please?
 

GMWolf

aka fel666
If you have a look at the demos, you will find the dungeon demo.
It makes use of a depth ordering system to get that to work. Probably your best option .

Alternatively
I believe depth = -y will still work (at the cost of performance).
You will just have to ensure your backgrounds have a much higher depth and foreground much lower depth.

@hdarren I do beleive this is vastely improved. Having layers mean you no longer need to use arbitrary depths for objects.
 
Last edited:
I

Izzy Skinezy

Guest
I believe depth = -y will still work (at the cost of performance).


@hdarren I do beleive this is vastely improved. Having layers mean you no longer need to use arbitrary depths for objects.




depth -y is doing some weird things for me-- i dont know why but when I keep it in and use any deactivate function my sprites all flicker when travelling upwards?
 

breakmt

Member
I use depth = -y and it's work fine for me. At least for now :)
BTW, in Unity I saw one cool feature - it also has layers for object, but also every object in layer could have depth order in THIS layer and it will not affect to another layers. Ok, maybe it is not so cool. I've not decided yet.
 
Top