How to adjust YSORT detection?

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

I am currently using Ysort and it works as expected but I have a little problem on when Ysort starts sorting.

It only sorts after a few pixels above the sprite 2.and I want to make it a little more precise as I want to. Like if both of my sprites bottom started overlapping then it should sort it already, what happens is it is only sorting when my 1st sprite is almost in the middle of the 2nd sprite.

I’m not sure why.

:bust_in_silhouette: Reply From: jjcdesamito

I was able to fix this by adjusting the anchor point to the bottom.

If you are using Sprite node:
Just select the sprite node then hold v then move the + sign on the screen to where you want to put the anchor.
Or
Select the sprite node then go to Inspector > Sprite > Offset then adjust the values.

If you are using TileMap:
Edit the tileset > Select the tile > Inspector > Selected Tile > Tex Offset then adjust the values.

Please take note that in my case I was using collision so I also had to adjust the position of those nodes.

Thanks, just what I needed!

Robert van Engelen | 2020-12-20 11:00

1 Like