Background for Fallout 4
Member of the ObjectReference script
voidfunctionMoveTo(ObjectReferenceakTarget, floatafXOffset=0.0, floatafYOffset=0.0, floatafZOffset=0.0, boolabMatchRotation=true)Native

Description

Wiki Description

Moves this reference to the location of the target reference, with the specified offset.

Documentation Comment

Moves this object to the position of the specified object, with an offset, and optionally matching its rotation


Caveats

CK Wiki - Notes

  1. Calling a MoveTo on the Player will cause the game to fade-out and fade-in automatically.
  2. If we are moving the Player, and the distance between the MoveTo target and the Player is very small, we don't call for the automatic fade-out. There's a [General] INI setting called fMinPlayerMoveToDistForLoadScreen which defines the minimum distance to call for a loadscreen.
  3. Using MoveTo, or any of the other Move function, on a Static can cause flickering on the model edges and blurring of the texture. To combat this, immediately call a disable() then enable() on the model to force it to reload in the new position.
  • This can cause the pip-boy model to display incorrectly when MoveTo is called on the player.Source
  • Moving the player to a furniture object, such as a terminal, will cause the player to enter it(use it) when the move is complete.
  1. If an object has weird angles(tilted) upon being moved by this function, this can be corrected by calling ObjectReference.SetAngle(...) and passing 0.0 into all the parameters.

Parameters

ObjectReferenceakTarget

CK Wiki Description

The target reference to move this one to.

  • Note:This can accept non-persistent references in containers. In which case the object is moved to the container's location (and not into the container).

floatafXOffset=0.0

CK Wiki Description

How much to offset the move in the X direction.

floatafYOffset=0.0

CK Wiki Description

How much to offset the move in the Y direction.

floatafZOffset=0.0

CK Wiki Description

How much to offset the move in the Z direction.

boolabMatchRotation=true

CK Wiki Description

Whether the moved object should match the rotation of the target object or not


Examples

; Move Bob to his house, designated by a marker
Bob.MoveTo(BobsHouseMarker)
; Move Bob to his house, but don't match the rotation of the marker
Bob.MoveTo(BobsHouseMarker, abMatchRotation = false)

Auto-Generated Example

ObjectReference myObjectReference__akTarget
float myFloat__afXOffset
float myFloat__afYOffset
float myFloat__afZOffset
bool myBool__abMatchRotation

myObjectReference__toCallFunctionOn.MoveTo(myObjectReference__akTarget, myFloat__afXOffset, myFloat__afYOffset, myFloat__afZOffset, myBool__abMatchRotation)

Related Pages


Additional References

View this function’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.