Z order of MeshInstance 2d Ignored at runtime?

Godot Version

4.4

Question

Hi, I’ve got a 2d scene with a background image and a MeshInstance2d, where I use a shader to move the vertices around in the meshinstance. They work as expected in the editor, but when I run the game, the mesh is behind/underneath the background image. I’ve set the z-orders on the background to -1, the meshinstance to 6, moved them around in the scene tree, etc, and it doesn’t make a difference.

At runtime: (The green pixels, there are many of them behind the gray layer… they are visible when I hide the gray layer.)

Following up because I doubt this is intended behavior: when I put only the mesh node into my scene, it works as intended. (So, problem solved in this case.)
When the mesh is a sub-node to a node2D in a separate scene (ship_dissolve.tscn) and that scene is added in, this is where the problem happens.

that is not a bug.
nodes are rendered in the order they appear in the tree. sorting is only really effective with sibling nodes.
if you want a node to appear over another, put it under a different node2D or CanvasLayer.

It can’t be intended behavior that 1- it’s completely different between the editor and the game, 2- Z-order has no effect. The entire reason for having Z-order is to determine what is on top of what.

Also I mentioned that I moved the parent node around in the scene tree and it doesn’t make a difference. It doesn’t make any sense for a child node to never be rendered above any of its parent’s siblings. That defeats the entire purpose of having a scene tree.