I can't get YSort to work...
- Edited
Y-sort works by the object pivot(origin) point.
remember that in the case of an instanced scene the scenes 0, 0 is the origin.
so would I just need to set the scene's origin at the same time I set its position when the scene is instanced?
The way my game is built, each tree is generated as a scene at runtime, and in order to get them into the right place, I had to manually position it when it's created. Is there a built-in variable for the pivot?
So, the pivot is where the tree is positioned on its scene yeah? My player and Tree are both placed so the 0,0 point is at the base:
This doesn't seem to make any difference though. I'm so lost.
Well, it's working here... are you sure the YSort node is turned on? It's got a property for controlling it's effective state, maybe you have it set to off?
Also, make sure you haven't got any z-index interfering with the ysort.
For another tutorial on ysort
@Stefan_GameDev said: Also, make sure you haven't got any z-index interfering with the ysort.
OH MY GOD! Even without the video, that single sentence solved my problem. I had the Z-index set to 1 on both the player and the tree because I was layering them differently before. I figured that if they were on the same index, the YSort should keep them in line. I never thought to just reset them to zero...
I'm still really new with godot, and just as I thought it would be, this was something super silly that I should have recognized lol
Thank you so much. This has been killing me for the last few days
YSort should work with 2 nodes being on the same z-index, but maybe they were set to relative and one got more z-index from its parents than the other.
Anyway, glad you got it working :)