Rotating Sprite

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By kushal2011

I’m a complete noob to Godot and was going to make a snake game. I followed a few tutorials and got the basic mechanics down but one thing has always confused me. RIght now, I have a snake head sprite that isnt rotating based on the keyboard inputs. Basically the snake head moves the direction that the player inputs, but the head texture itself isnt rotating. And when I do set the rotation degrees in the code, it completely messes with the program and I think its because its rotating about a different axis than the center of the sprite. Anyone have a solution?

And when I do set the rotation degrees in the code, it completely messes with the program and I think its because its rotating about a different axis than the center of the sprite.

What’s your understanding of " completely messes with the program"? :wink: How does your code look like? The centered-property of Sprites is true by default, meaning that rotating the Sprite will rotate around the center point.

njamster | 2020-05-02 14:50

:bust_in_silhouette: Reply From: Traumaticbean

rotation = velocity.angle() might help.