SetAngle - ObjectReference

Member of: ObjectReference Script

Sets the object's current rotation in the world.

SyntaxEdit

Function SetAngle(float afXAngle, float afYAngle, float afZAngle) native

ParametersEdit

  • afXAngle: Rotation around the X axis, in degrees.
  • afYAngle: Rotation around the Y axis, in degrees.
  • afZAngle: Rotation around the Z axis, in degrees.

Return ValueEdit

None.

ExamplesEdit

; Set the statue to be facing the other way (180 around Z)
; Z is the compass direction
StatueProperty.SetAngle(0.0, 0.0, 180.0)

NotesEdit

  • When rotating an object, it is important to know the order in which the rotation angles are applied. The Z-axis rotation (yaw: north/south/east/west) is applied first, followed by the Y-axis (roll: tilt) and finally the X-axis (pitch: forward/backward).
  • Skyrim appears to use extrinsic left-handed XYZ angles.
    • Extrinsic means that world-relative axes are used. Rotating an object along one axis won't change its other axes.
    • Left-handed means that objects rotate clockwise as angles increase, as opposed to right-handed systems that use counter-clockwise rotations.
  • If called on an object whose 3D is not currently loaded (even if the reference is persistent -- which of course it would be if you have an ObjectReference variable pointing at it with which to call this function), this will fail. There will be no error in the script log, but the angles will not actually be changed.

See AlsoEdit