Angle between two objects

I know position of objects A and B and I want to know angle α, How would I go a bout doing it.
s7a6d567sa5d765asd

local ang = (b - a):Angle()

This’ll give you the angle from point a to b

If you need a direction vector instead you’ll want to replace the Angle() call with GetNormalized() (Or nothing at all if you don’t care or don’t want a normalized vector)

1 Like

You can also do

local pos = a - b
pos = math.atan2(pos.y, pos.x)

Also, atan2 gives you the angle in radians, you can convert it to degrees with math.deg()

1 Like