I'm at X,Y - target at X,Y - How calculate angle to face target?
- I am at 10, 25 (x,y)
- target at 5, -10 (x,y)
- I'm facing 0º
How can I calculate the correct angle to face the target?
About this question: I am building a script on javascritp, so I guess I really need to use vanilla maths here,
if I were coding/scrip in some 3D software it would be easy as use something like "transform,x,y"...
EDIT: Got it working, thanks for the Tutors! Here's the code I'm using:
ps: Instead of 380º the game reads that as 256units (probably because needs to be sent as Unsigned Integers of bits) and needed te result to be 0-256 (wihtout negative numbers)