0 votes

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.

in Engine by (27 points)

1 Answer

+2 votes

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.

by (27 points)

Thanks, just what I needed!

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 Frequently asked questions and 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 [email protected] with your username.