Topic was automatically imported from the old Question2Answer platform.
Asked By
YuleTide
Hello I am having an issue with y-sort and my player character. It doesnt seem to update the y-sort location for my player character. If I start the scene with a sprite lower than my player then that sprite is always drawn on top of the player and if I start the sprite above my player then it is always drawn below the player no matter how the player moves.
If it is, are you sure you’re moving the player not just the sprite? Can we see your node hierarchy?
Thanks, I think you might be right with the sprite not moving only the image of the player moving. I took a screenshot of the node structure but I cannot seem to upload it here.
I had a print in the characters script and this updated with new positions but when I created a test scene with just a y-sort and a few sprites and told the script attached to y-sort to print the players position continuously it didnt move from the starting location.
I am still not sure how to fix it but thanks I think at least this is pointing in the right direction.
This problem might also be caused by the position of your objects in their root scenes not being (0,0).
Please let us see your node configuration.
Thanks I had actually thought of that and had experimented but that wasnt the problem. I think for some reason even though the sprite on screen is moving the global position of the player is not. It might be because the top node is a node2d with the kinematic node underneath this? I am not sure. Thanks for trying to help though!