0 votes

I've got a square with a collision. When the square jumps the sprite turns in the air but the collision doesn't. When it lands the rotation of the sprite just turns to zero but I want it to turn pretty fast to the closest side. How do I do that?

in Engine by (33 points)

Hero do you have the collision setup? What is turning when the square jumps? Is the collision a child of the main character node?

1 Answer

0 votes

Rotate to closest side?
You should have x </> and then rotation.x = 180/-180
Also calculate the center of where the player is and idk how to do that but I think you can.
Hope this helps!

by (32 points)

My project is 2D not 3D
And the center is literally the sprite's position or the collision's position, they're the same

Do you mean the "center" the center above the corner or the center of the player itself?

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.