Papyrus - Moving Statics with TranslateTo

Attach reference animation is useful if you want to move any arbitrary static on a whim, but if you require specific movement in terms of coordinates and orientation, and want to preserve collision, then using TranslateTo is preferable.

You must modify the NIF file of the mesh you want to translate in the following way:

  1. Extract meshes\dlc01\architecture\snowelfruins\dlc1waygate.nif for an example of an animating mesh with collision
  2. Notice that in bhkCollisionObject -> bhkRigidBody the Layer and Layer Copy values are set to OL_ANIM_STATIC and Motion System to MO_SYS_BOX. Change the values in your desired mesh to those values.
  3. Add your new mesh as a MoveableStatic
  4. Add a custom trigger and link the mesh you just imported as a LinkedRef in the trigger.
  5. Use OnTriggerEnter or similar event and call TranslateTo on the link reference.

In this example, when someone enters the trigger, it will move the desired object upwards by 256 units:

Event OnTriggerEnter(ObjectReference akRef)
GetLinkedRef().TranslateTo(GetLinkedRef().X, GetLinkedRef().Y, GetLinkedRef().Z + 256, 0, 0, 0, 100.0)
endEvent

The downside to this is that you must modify every mesh that you want to move. Attach reference animation is better if you want to apply a generic motion to any arbitrary Static or MoveableStatic object.

Note that usage of this method for lifts and elevators with a collision object of type bhkMoppBvTreeShape in Creation Engine is unstable. It should only be used with stable collision object types such as bhkConvexVerticesShape.