0 votes

I am using YSort node to sort objects in the scene.It is working good.

But when my character jumping , it showing the character behind the other objects because y cordinate decreasing.

What should i do to keep my characters depth same when jumping?

in Engine by (18 points)

When jumping on a top-down game, perhaps its better to offset the sprites/collisions instead of moving the whole body. That way the position is still the same. Try changint sprite offset.

─░nstead using YSort node, i used zindex = position.y for all objects.
For player i made a temporary variable which store y position before jump and using this variable as a z
index while jumping.It is worked fine.Is this solution okay to use?

If it works, sure! why not? as far as i know, using ysort is very similar to that.

Please log in or register to answer this question.

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 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 webmaster@godotengine.org with your username.