Functions
MoveEntity
Moves an entity to a target position using a named transition.
MoveEntity(transitionName, entity, targetPosition, duration)transitionName:stringThe name of the transition preset (e.g.,"Linear").entity:numberThe entity to move.targetPosition:vector3The world position to move the entity to.duration:numberTime in seconds to complete the move.
Example:
local pos = vec3(0.0, 0.0, 2.0)
exports.rw_transform:TransitionEntity("Linear", entity, pos, 2)RotateEntity
Rotates an entity to a new orientation using a named transition.
RotateEntity(transitionName, entity, targetRotation, duration, rotationMode?)transitionName:stringThe name of the transition preset (e.g.,"Linear").entity:numberThe entity to rotate.targetRotation:vector3The world rotation (in degrees).duration:numberTime in seconds to complete the rotation.rotationMode?:stringpreset"clockwise"or"counterclockwise"Defaults to the shortest path.
Example:
local rad = vec3(0.0, 0.0, 60.0)
exports.rw_transform:RotateEntity("Linear", entity, rad, 2)RotateEntity("Linear", entity, rad, 2, "counterclockwise")TransitionEntity
Moves and rotates an entity simultaneously using a named transition.
TransitionEntity(transitionName, entity, targetRotation, targetPosition, duration, rotationMode?)transitionName:stringThe name of the transition preset (e.g.,"Linear").entity:numberThe entity to transform.targetRotation:vector3The rotation to apply.targetPosition:vector3The position to move to.duration:numberTime in seconds to complete the transformation.rotationMode?:string"clockwise"or"counterclockwise"Defaults to the shortest path.
Example:
local rad = vec3(0.0, 0.0, 60.0)
local pos = vec3(0.0, 0.0, 2.0)
exports.rw_transform:TransitionEntity("Linear", entity, rad, pos, 2)