#How I can make the ship rotate to the direction of the movement?
9 messages · Page 1 of 1 (latest)
Add this
rotation = lerp_angle(rotation, velocity.angle(), 0.1)
It should rotate slowly but I believe the result will be wrong due to your setup. In godot 0 degree is facing right
Oh
I added it and rotated the entire object 90 degrees, and it's working
The only thing being that once I stop pressing keys, the ship goes back to being 90 degrees again
This is my code rn
@bleak raptor If the velocity vector is zero, then velocity.angle() can't be relied upon to give any sensible answer at all. It seems like what you really want to do is change the rotation only when the ship is moving (so velocity is not zero) not when it is standing still.
Yes! Thank you!