-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Control node draws out of order if it was initially a child of type Node #63183
Comments
I remember there was an error when trying to call Anyway, as a workaround, you can |
That does result in the correct drawing order in the test project, but not in my actual program where the code instantiating the control node wasn't in a _ready call at all. I couldn't tell you what the difference is, but I am certain the problem stopped happening when I changed the type of the initial parent (an autoload) from Node to Control. |
A little more info. Here's a modified _ready call that also reproduces the issue, with a 1 frame delay:
and inserting another idle_frame between the first add_child and the second remove_child fixes it again... but I don't know why such a thing would be necessary. In my full program I have observed that the node appears initially with the correct drawing order, but seemingly irrelevant changes made elsewhere in the tree cause it to jump out of order, and other irrelevant changes would put it back in the right draw order. It's incredibly fickle, but easily reproducible. |
Godot version
v3.4.4.stable.mono.official [419e713]
System information
Windows 10
Issue description
Saw this on a project I was working on, where a control node would be created as the child of a node, then reparented into it's correct location. Occasionally nodes initialized this way would draw in the wrong order, despite being in the right order in the tree.
The issue is present both with and without batched rendering.
Here's a screenshot of my test scene alongside the debug Remote tree. The red object should draw on top.
Steps to reproduce
This isn't the only way to reproduce this, but this is the approach in my reproduction scene.
First create a control node as a child of a type Node that is above the destination in the tree.
Then reparent the control node such that it is now below at least two siblings that were below it before.
Note the rendering order is incorrect.
Minimal reproduction project
Here's my test scene RenderingOrderIssue.zip
The text was updated successfully, but these errors were encountered: