Get 2d rotation between vectors

Godot Version



how would i get the direction between Vector(0, 1) and Vector(1, 0)

if you want just the angle from one vector to another use the atan2 function

var diff: Vector2 = Vector2.RIGHT - Vector2.UP
var angle := atan2(diff.y, diff.x)

print(angle) # radians so: PI/2

Godot has angle_to_point function for that purpose(returns radian).
There is also direction_to if you want normalized vector between 2 points instead.

1 Like

yall have been saving my butt today. thnx