Ysort related question

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Skydome

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 Screenshot-23 hosted at ImgBB — ImgBB

                      ![YSort_1][1]   ![YSort_2][2] ![YSort_3][3]

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.

Skydome | 2019-03-31 19:04

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?

jjcdesamito | 2019-06-05 16:47

Lol I am only now noticing this comment
Did you figure it out?

Skydome | 2022-05-16 20:59

:bust_in_silhouette: Reply From: flurick

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