0 votes

So I have been using YSort node and I want to change something. I want to change at exactly what point in the yaxis for a sprite the sort happens. It's happening a little late in one case. The images I uploaded will explain better what I mean. As you can see in the third image I would like the character to appear behind the light. So far I was thinking of putting the light as a child node of another so that the sorting happens based on that since YSort ignores child nodes. But I was wondering if there are other solutions.
Hmm there's a problem with the image upload so here are the links https://ibb.co/5WX3CCg

https://ibb.co/LR0tdhw

https://ibb.co/yQXDK9h

                      ![YSort_1][1]   ![YSort_2][2] ![YSort_3][3]
in Engine by (106 points)

Another way I found was by going to the character scene and traffic light scene and making it so that the base node is at the bottom of the sprite instead of center. Seems to have worked but I am still looking for alternatives.

Hi, I also encountered this problem. Can you give me a step by step on how you made it worked? I already read your comment on making the base node on the bottom of the sprite but I'm not sure how you did it?

1 Answer

0 votes

Yeah! Use a Node2D (as a parent to the Sprite) to mark the depth of the nodes.

by (911 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.