godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.85k stars 20.15k forks source link

`z_index` bug in nodes2D #96009

Open felipefacundes opened 2 weeks ago

felipefacundes commented 2 weeks ago

Tested versions

4.3.stable

System information

Linux

Issue description

Initially, I noticed the z_index bug in Parallax 2D, I had to leave them all at the default 0, but I identified that the bug extended to other 2D nodes.

Steps to reproduce

All of the above

Minimal reproduction project (MRP)

All of the above

AThousandShips commented 2 weeks ago

Please explain the actual bug

felipefacundes commented 2 weeks ago

Explaining this bug in more detail:

Initially, I noticed a z-index bug in Parallax 2D, where the children of each Parallax were out of order—some appeared behind others, even though the hierarchy was correct. Additionally, some items were changing their order even though they belonged to the same node. I had to reset the z-index to the default value of 0 for the behavior to be as expected. While the z-index issue in Parallax2D was resolved by resetting the z-index to 0, I discovered that this bug also affects other 2D nodes. In my scene, for example, some items disappeared—one instance of a moving platform was visible, while another with the same configuration was hidden, even though all child nodes had z-index = 0. I performed several exhaustive tests on the node hierarchy, and the hierarchy is correct. The z-index bug is evident in this new version, 4.3.stable.

AThousandShips commented 2 weeks ago

Please break it down into clear instructions and add an MRP to make testing this easier: