GetHeadingAngle - ObjectReference

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

Member of: ObjectReference Script

Gets the angle between this object's heading, and the direction the other object is in, in degrees. If you were to add this angle to this object's rotation around the z axis, and then set the rotation of this object to that - it would be facing the other object.

Syntax[edit | edit source]

float Function GetHeadingAngle(ObjectReference akOther) native

Parameters[edit | edit source]

  • akOther: The other object to get the angle to.

Return Value[edit | edit source]

The angle in degrees between this object's heading and the other object's direction.

Examples[edit | edit source]

; Have the statue face the player
float zOffset = Statue.GetHeadingAngle(Game.GetPlayer())
Statue.SetAngle(Statue.GetAngleX(), Statue.GetAngleY(), Statue.GetAngleZ() + zOffset)

See Also[edit | edit source]