Background for Skyrim SE
Member of the ObjectReference script
voidfunctionTranslateTo(floatafX, floatafY, floatafZ, floatafXAngle, floatafYAngle, floatafZAngle, floatafSpeed, floatafMaxRotationSpeed=0.0)Native

Description

Wiki Description

Makes the object translate to the passed in position and orientation at the given speed.

Documentation Comment

Makes the reference translate to the given position/orientation
Note: Rotation speed is entirely dependent on the length of the path and the movement speed
that is, the rotation will happen such that the reference reaches the goal orientation at the end
of the translation.


Caveats

CK Wiki - Notes

  • The movement speed is in units per second.
  • The rotation speed is in degrees per second.
  • afMaxRotationSpeed equal to 0 means that the object will reach the target rotation when it reaches the target position.
  • It is not possible to cause the object to rotate faster than it would with afMaxRotationSpeed equal to 0. (Cannot reach target rotation before target position.)
  • The OnTranslationComplete event will fire when the object reaches both the target position and target rotation.
  • The OnTranslationAlmostComplete event can fire even when the target rotation is far from being reached.

Parameters

  1. floatafX

    CK Wiki Description

    Position along the X axis (Absolute world coordinates).

  2. floatafY

    CK Wiki Description

    Position along the Y axis (Absolute world coordinates).

  3. floatafZ

    CK Wiki Description

    Position along the Z axis (Absolute world coordinates).

  4. floatafXAngle

    CK Wiki Description

    Destination X Angle (Absolute world rotation).

  5. floatafYAngle

    CK Wiki Description

    Destination Y Angle (Absolute world rotation) (rarely used).

  6. floatafZAngle

    CK Wiki Description

    Destination Z Angle (Absolute world rotation).

  7. floatafSpeed

    CK Wiki Description

    Movement Speed.

  8. floatafMaxRotationSpeed=0.0

    CK Wiki Description

    Maximum rotation Speed (default is 0 to mean "don't clamp the rotation speed") - Negative values cause unpredictable rotation.


Examples

; Translate the bird slowly to 0,0,0 with a rotation of 90,90,90
Bird.TranslateTo(0.0, 0.0, 0.0, 90.0, 90.0, 90.0, 1.0)
; Translate the bird slowly to 0,0,0 with a rotation of 90,90,90 with a max rotation speed of 10
Bird.TranslateTo(0.0, 0.0, 0.0, 90.0, 90.0, 90.0, 1.0, 10.0)

Auto-Generated Example

float myFloat__afX
float myFloat__afY
float myFloat__afZ
float myFloat__afXAngle
float myFloat__afYAngle
float myFloat__afZAngle
float myFloat__afSpeed
float myFloat__afMaxRotationSpeed

myObjectReference__toCallFunctionOn.TranslateTo(myFloat__afX, myFloat__afY, myFloat__afZ, myFloat__afXAngle, myFloat__afYAngle, myFloat__afZAngle, myFloat__afSpeed, myFloat__afMaxRotationSpeed)

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.