Difference between revisions of "GetHeadingAngle"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>SJML Bot
(Bot creating condition functions pages.)
 
imported>Antares
(Updated article with information pertaining to running this condition function on the Player.)
 
Line 18: Line 18:
   player.setangle z angle
   player.setangle z angle
    
    
==Notes==
This function seems to be broken when checking Player Heading-Angle relative to a Given Reference, however the reverse does work as expected (checking Given Reference Heading-Angle relative to the Player). See [[Talk:GetHeadingAngle|talk]] page for more info.
==Papyrus Version==
==Papyrus Version==
[[GetHeadingAngle - ObjectReference]]
[[GetHeadingAngle - ObjectReference]]

Latest revision as of 04:52, 27 July 2018

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
  

Notes[edit | edit source]

This function seems to be broken when checking Player Heading-Angle relative to a Given Reference, however the reverse does work as expected (checking Given Reference Heading-Angle relative to the Player). See talk page for more info.

Papyrus Version[edit | edit source]

GetHeadingAngle - ObjectReference