GetHeadingAngle

From the Oblivion ConstructionSet Wiki
Revision as of 11:38, 16 July 2010 by imported>DragoonWraith (Reverted edits by Susie (Talk); changed back to last version by Vswe)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Syntax:

GetHeadingAngle ObjectRefID

Example:

GetHeadingAngle StrangeStatue 


Returns the angle between the caller's heading and the ObjectRefID in a range from -180 to 180.

For example, say the player is facing due north. The object StrangeStatue is due west of the player. The command:

  player.GetHeadingAngle StrangeStatue 

would return -90.


When you add this value to the player's current heading angle, he will face the statue:

  set angle to player.getangle z + player.GetHeadingAngle StrangeStatue
  player.setangle z angle