Functions
MoveEntity
Moves an entity to a target position using a named transition.
MoveEntity(transitionName, entity, targetPosition, duration)
transitionName
:string
The name of the transition preset (e.g.,"Linear"
).entity
:number
The entity to move.targetPosition
:vector3
The world position to move the entity to.duration
:number
Time 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
:string
The name of the transition preset (e.g.,"Linear"
).entity
:number
The entity to rotate.targetRotation
:vector3
The world rotation (in degrees).duration
:number
Time in seconds to complete the rotation.rotationMode?
:string
preset"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
:string
The name of the transition preset (e.g.,"Linear"
).entity
:number
The entity to transform.targetRotation
:vector3
The rotation to apply.targetPosition
:vector3
The position to move to.duration
:number
Time 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)