Background for Skyrim SE
Member of the ObjectReference script
voidfunctionSetAngle(floatafXAngle, floatafYAngle, floatafZAngle)Native

Description

Wiki Description

Sets the object's current rotation in the world.

Documentation Comment

Set the orientation of the object (angles are in degrees)


Caveats

CK Wiki - Notes

  • 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.


Parameters

floatafXAngle

CK Wiki Description

Rotation around the X axis, in degrees.

floatafYAngle

CK Wiki Description

Rotation around the Y axis, in degrees.

floatafZAngle

CK Wiki Description

Rotation around the Z axis, in degrees.


Examples

; 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)

Auto-Generated Example

float myFloat__afXAngle
float myFloat__afYAngle
float myFloat__afZAngle

myObjectReference__toCallFunctionOn.SetAngle(myFloat__afXAngle, myFloat__afYAngle, myFloat__afZAngle)

Related Pages


Additional References

View this function’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.