This is extremely confusing. +z gets closer to the screen as it should yet high z gets drawn first then overwritten by things that are supposed to be behind it since they are drawn after.
The manual has a nice image on this on the
layer_depth page.
As you can see there, when looking downward from the camera, depth values (or z values) become more positive. If you now apply the same logic to your own layer setup, you notice that drawing happens in the following order:
Code:
Camera
v v
Instances 0 // Drawn first/below everything
Managers -100
Tiles -200
Background -300 // Drawn last/on top of everything
^ ^
Screen
I added the camera to show that you're actually looking towards -z here.
But here's the catch. Although you have inverted the layers' depth/z values and setup the camera to correspond to that, the layers are still drawn from highest (most +) depth to lowest (most -) depth.
Most important is that each layer's contents are drawn and then that layer is finished.
It's as if you would draw that layer's contents to a surface and immediately draw that surface to the screen (or the 'back buffer', I guess). Then the next layer (more negative z/depth) is drawn and, once again, drawn to the screen. The order in which that happens is fixed and is from highest depth to lowest depth.
In fact this means that depth comparisons occur between primitives on the same layer but not between primitives on different layers (because of the above).
So it's best to indeed point the camera to +z, "into the screen", and then also change the depth (i.e. draw order) of the layers.
Another way would be to put everything onto one (instance) layer, but then you loose the ease of use for layers like the Tiles layer.
Admittedly, 3D in GMS does get a bit confusing when combined with layers
.
I've had the background set this entire time and never disabled it.
Not sure about this, though..