Feed in the x and z data from your three point vector...
- Code: Select all
local heading = math.atan2( vector[1], vector[3] )
LOG(' heading: ', heading)
A log result of:
Spoiler: show
Hence a value of -2.4257481098175 is somewhere south / east of our target. (Relative to the map not the unit)
Note: Used the vector data from unit.lua DoTakeDamage to test this. No engineers were hurt during the testing of this script.
Resin