I think you mean you want to find the angle of a vector, which is what you would need to put in the rotation
. You can get that with vector.angle()
. For example, if you have a velocity
vector for your movement, you could rotate to match that vector's angle with
rotation = velocity.angle()