0 votes

I have the player character in a room with another object, both with Y-sort enabled. The object's y-position is 189 px, but the player doesn't render in front of the object until their y-position crosses 219 px or so. Any ideas why this would be the case?

Godot version v4.0.beta3.official [01ae26d31]
in Engine by (21 points)

1 Answer

0 votes
Best answer

Never mind, I figured it out. I was just misunderstanding how y-sort works in Godot 4.

Basically, the "Y Sort Enabled" option doesn't tell a node to let itself be y-sorted, but rather to y-sort its children. I had it enabled on the player and object, so Godot was just y-sorting their sprites based on their own positions instead of the parent nodes' positions.

by (21 points)
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.