A function included in the GECK version 22.214.171.124.
Returns the angle between the calling reference and the specified object in a range from -180 to 180 degrees.
(-180 to 180:float) [Object].GetHeadingAngle ObjectRef:ref
- Do not confuse this function with GetAngle Z, which returns the heading angle of an object relative to the world.
- The direction the calling reference is facing is considered 0 degrees.
- Angles measured clockwise from 0 are positive, while angles measured counter-clockwise from 0 are negative.
- In the example above, if the player is facing north and the object StrangeStatue is due west of the player, the returned value would be -90.
- When you add this value to the calling references's current heading angle (Z angle), he will face the specified ObjectRef:
set angle to Player.GetAngle Z + Player.GetHeadingAngle StrangeStatue Player.SetAngle Z angle