The Mover handles adding moves to process for an object.
public class Mover : Sansar.Script.InstanceInterfaceRemarks
The Movable From Script flag must be set to true in the editor to use the Mover. Additionally, player characters and rigid bodies with Static or Dynamic motion types cannot be moved using the Mover. Unlike the RigidBodyComponent movement functions, the Mover can be applied to objects that do not contain Volumes.
Members at a glance
| Kind | Members |
|---|---|
| Properties | IsMoving · MoveCount |
| Methods | AddMove New in 47.10.0 · AddMoveOffset New in 47.10.0 · AddPause · AddRotate · AddRotateOffset · AddTranslate · AddTranslateOffset · StopAndClear · ToString |
Properties
IsMoving
public bool IsMoving { get; }Property to check if a move command is currently executing for this Mover.
Value: bool — Whether or not this object is currently executing a move (includes pauses).
MoveCount
public int MoveCount { get; }The number of move commands waiting to be excuted and currently executing for this Mover.
Value: int — The number of enqueued move commands. Includes the current active move and any pause commands.
Methods
AddMove
public void AddMove(
Sansar.Vector position,
Sansar.Quaternion rotation
)Sets the transform of this Mover to a target World Space position and rotation.
| Parameter | Type | Description |
|---|---|---|
position | Sansar.Vector | The target position. |
rotation | Sansar.Quaternion | The target rotation. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddMove(
Sansar.Vector position,
Sansar.Quaternion rotation,
Action<Sansar.Script.OperationCompleteEvent> handler
)Sets the transform of this Mover to a target World Space position and rotation.
| Parameter | Type | Description |
|---|---|---|
position | Sansar.Vector | The target position. |
rotation | Sansar.Quaternion | The target rotation. |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddMove(
Sansar.Vector targetPosition,
Sansar.Quaternion targetRotation,
double timeInSeconds,
MoveMode interpolationMode
)Translate and rotate the Mover to the target World Space position and rotation over time.
| Parameter | Type | Description |
|---|---|---|
targetPosition | Sansar.Vector | The target position. |
targetRotation | Sansar.Quaternion | The target rotation. |
timeInSeconds | double | The time in seconds to move over. |
interpolationMode | MoveMode | The method of interpolation to use when moving |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddMove(
Sansar.Vector targetPosition,
Sansar.Quaternion targetRotation,
double timeInSeconds,
MoveMode translationMode,
MoveMode rotationMode
)Translate and rotate the Mover to the target World Space position and rotation over time, using separate interpolation modes.
| Parameter | Type | Description |
|---|---|---|
targetPosition | Sansar.Vector | The target world space position. |
targetRotation | Sansar.Quaternion | The target world space rotation. |
timeInSeconds | double | The shared duration in seconds for translation and rotation. |
translationMode | MoveMode | The interpolation mode applied to translation only. |
rotationMode | MoveMode | The interpolation mode applied to rotation only. |
Remarks
This asynchronous method queues one combined move command then returns. Translation and rotation run together for the same duration and share one completion event. To block until both have completed, pass a lambda that calls the handler overload to ScriptBase.WaitFor while in a coroutine.
public void AddMove(
Sansar.Vector targetPosition,
Sansar.Quaternion targetRotation,
double timeInSeconds,
MoveMode interpolationMode,
Action<Sansar.Script.OperationCompleteEvent> handler
)Translate and rotate the Mover to the target World Space position and rotation over time.
| Parameter | Type | Description |
|---|---|---|
targetPosition | Sansar.Vector | The target position. |
targetRotation | Sansar.Quaternion | The target rotation. |
timeInSeconds | double | The time in seconds to move over. |
interpolationMode | MoveMode | The method of interpolation to use when moving |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddMove(
Sansar.Vector targetPosition,
Sansar.Quaternion targetRotation,
double timeInSeconds,
MoveMode translationMode,
MoveMode rotationMode,
Action<Sansar.Script.OperationCompleteEvent> handler
)Translate and rotate the Mover to the target World Space position and rotation over time, using separate interpolation modes.
| Parameter | Type | Description |
|---|---|---|
targetPosition | Sansar.Vector | The target world space position. |
targetRotation | Sansar.Quaternion | The target world space rotation. |
timeInSeconds | double | The shared duration in seconds for translation and rotation. |
translationMode | MoveMode | The interpolation mode applied to translation only. |
rotationMode | MoveMode | The interpolation mode applied to rotation only. |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
This asynchronous method queues one combined move command then returns. Translation and rotation run together for the same duration and share one completion event. To block until both have completed, pass a lambda that calls the handler overload to ScriptBase.WaitFor while in a coroutine.
AddMoveOffset
public void AddMoveOffset(
Sansar.Vector positionOffset,
Sansar.Quaternion rotationOffset
)Sets the transform of this Mover to a target Local Space position and rotation.
| Parameter | Type | Description |
|---|---|---|
positionOffset | Sansar.Vector | The local space position offset. |
rotationOffset | Sansar.Quaternion | The local space rotation offset. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddMoveOffset(
Sansar.Vector positionOffset,
Sansar.Quaternion rotationOffset,
Action<Sansar.Script.OperationCompleteEvent> handler
)Sets the transform of this Mover to a target Local Space position and rotation.
| Parameter | Type | Description |
|---|---|---|
positionOffset | Sansar.Vector | The local space position offset. |
rotationOffset | Sansar.Quaternion | The local space rotation offset. |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddMoveOffset(
Sansar.Vector positionOffset,
Sansar.Quaternion rotationOffset,
double timeInSeconds,
MoveMode interpolationMode
)Translate and rotate the Mover to the target Local Space position and rotation over time.
| Parameter | Type | Description |
|---|---|---|
positionOffset | Sansar.Vector | The local space position offset. |
rotationOffset | Sansar.Quaternion | The local space rotation offset. |
timeInSeconds | double | The time in seconds to move over. |
interpolationMode | MoveMode | The method of interpolation to use when moving |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddMoveOffset(
Sansar.Vector positionOffset,
Sansar.Quaternion rotationOffset,
double timeInSeconds,
MoveMode translationMode,
MoveMode rotationMode
)Translate and rotate the Mover by Local Space offsets over time, using separate interpolation modes.
| Parameter | Type | Description |
|---|---|---|
positionOffset | Sansar.Vector | The local space position offset from the final queued target transform. |
rotationOffset | Sansar.Quaternion | The local space rotation offset from the final queued target transform. |
timeInSeconds | double | The shared duration in seconds for translation and rotation. |
translationMode | MoveMode | The interpolation mode applied to translation only. |
rotationMode | MoveMode | The interpolation mode applied to rotation only. |
Remarks
This asynchronous method queues one combined move command then returns. Translation is applied in local space before the rotation offset, relative to the final queued target transform. Translation and rotation run together for the same duration and share one completion event. To block until both have completed, pass a lambda that calls the handler overload to ScriptBase.WaitFor while in a coroutine.
public void AddMoveOffset(
Sansar.Vector positionOffset,
Sansar.Quaternion rotationOffset,
double timeInSeconds,
MoveMode interpolationMode,
Action<Sansar.Script.OperationCompleteEvent> handler
)Translate and rotate the Mover to the target Local Space position and rotation over time.
| Parameter | Type | Description |
|---|---|---|
positionOffset | Sansar.Vector | The local space position offset. |
rotationOffset | Sansar.Quaternion | The local space rotation offset. |
timeInSeconds | double | The time in seconds to move over. |
interpolationMode | MoveMode | The method of interpolation to use when moving |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddMoveOffset(
Sansar.Vector positionOffset,
Sansar.Quaternion rotationOffset,
double timeInSeconds,
MoveMode translationMode,
MoveMode rotationMode,
Action<Sansar.Script.OperationCompleteEvent> handler
)Translate and rotate the Mover by Local Space offsets over time, using separate interpolation modes.
| Parameter | Type | Description |
|---|---|---|
positionOffset | Sansar.Vector | The local space position offset from the final queued target transform. |
rotationOffset | Sansar.Quaternion | The local space rotation offset from the final queued target transform. |
timeInSeconds | double | The shared duration in seconds for translation and rotation. |
translationMode | MoveMode | The interpolation mode applied to translation only. |
rotationMode | MoveMode | The interpolation mode applied to rotation only. |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
This asynchronous method queues one combined move command then returns. Translation is applied in local space before the rotation offset, relative to the final queued target transform. Translation and rotation run together for the same duration and share one completion event. To block until both have completed, pass a lambda that calls the handler overload to ScriptBase.WaitFor while in a coroutine.
AddPause
public void AddPause(double timeInSeconds)Adds a pause of the given length for this Mover.
| Parameter | Type | Description |
|---|---|---|
timeInSeconds | double | The amount of time in seconds that the movement should be paused. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddPause(
double timeInSeconds,
Action<Sansar.Script.OperationCompleteEvent> handler
)Adds a pause of the given length for this Mover.
| Parameter | Type | Description |
|---|---|---|
timeInSeconds | double | The amount of time in seconds that the movement should be paused. |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
AddRotate
public void AddRotate(Sansar.Quaternion rotation)Sets the rotation of this Mover to a target World Space rotation.
| Parameter | Type | Description |
|---|---|---|
rotation | Sansar.Quaternion | The target rotation. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddRotate(
Sansar.Quaternion rotation,
Action<Sansar.Script.OperationCompleteEvent> handler
)Sets the rotation of this Mover to a target World Space rotation.
| Parameter | Type | Description |
|---|---|---|
rotation | Sansar.Quaternion | The target rotation. |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddRotate(
Sansar.Quaternion targetRotation,
double timeInSeconds,
MoveMode interpolationMode
)Rotate the Mover to the target World Space rotation over time.
| Parameter | Type | Description |
|---|---|---|
targetRotation | Sansar.Quaternion | The target rotation. |
timeInSeconds | double | The time in seconds to move over. |
interpolationMode | MoveMode | The method of interpolation to use when moving |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddRotate(
Sansar.Quaternion targetRotation,
double timeInSeconds,
MoveMode interpolationMode,
Action<Sansar.Script.OperationCompleteEvent> handler
)Rotate the Mover to the target World Space rotation over time.
| Parameter | Type | Description |
|---|---|---|
targetRotation | Sansar.Quaternion | The target rotation. |
timeInSeconds | double | The time in seconds to move over. |
interpolationMode | MoveMode | The method of interpolation to use when moving |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
AddRotateOffset
public void AddRotateOffset(Sansar.Quaternion rotationOffset)Sets the rotation of this Mover to a target Local Space rotation.
| Parameter | Type | Description |
|---|---|---|
rotationOffset | Sansar.Quaternion | The local space rotation offset. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddRotateOffset(
Sansar.Quaternion rotationOffset,
Action<Sansar.Script.OperationCompleteEvent> handler
)Sets the rotation of this Mover to a target Local Space rotation.
| Parameter | Type | Description |
|---|---|---|
rotationOffset | Sansar.Quaternion | The local space rotation offset. |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddRotateOffset(
Sansar.Quaternion rotationOffset,
double timeInSeconds,
MoveMode interpolationMode
)Rotate the Mover to the target Local Space rotation over time.
| Parameter | Type | Description |
|---|---|---|
rotationOffset | Sansar.Quaternion | The local space rotation offset. |
timeInSeconds | double | The time in seconds to move over. |
interpolationMode | MoveMode | The method of interpolation to use when moving |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddRotateOffset(
Sansar.Quaternion rotationOffset,
double timeInSeconds,
MoveMode interpolationMode,
Action<Sansar.Script.OperationCompleteEvent> handler
)Rotate the Mover to the target Local Space rotation over time.
| Parameter | Type | Description |
|---|---|---|
rotationOffset | Sansar.Quaternion | The local space rotation offset. |
timeInSeconds | double | The time in seconds to move over. |
interpolationMode | MoveMode | The method of interpolation to use when moving |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
AddTranslate
public void AddTranslate(Sansar.Vector position)Sets the position of this Mover to a target World Space position.
| Parameter | Type | Description |
|---|---|---|
position | Sansar.Vector | The target position. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddTranslate(
Sansar.Vector position,
Action<Sansar.Script.OperationCompleteEvent> handler
)Sets the position of this Mover to a target World Space position.
| Parameter | Type | Description |
|---|---|---|
position | Sansar.Vector | The target position. |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddTranslate(
Sansar.Vector targetPosition,
double timeInSeconds,
MoveMode interpolationMode
)Translate the Mover to the target World Space position over time.
| Parameter | Type | Description |
|---|---|---|
targetPosition | Sansar.Vector | The target position. |
timeInSeconds | double | The time in seconds to move over. |
interpolationMode | MoveMode | The method of interpolation to use when moving. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddTranslate(
Sansar.Vector targetPosition,
double timeInSeconds,
MoveMode interpolationMode,
Action<Sansar.Script.OperationCompleteEvent> handler
)Translate the Mover to the target World Space position over time.
| Parameter | Type | Description |
|---|---|---|
targetPosition | Sansar.Vector | The target position. |
timeInSeconds | double | The time in seconds to move over. |
interpolationMode | MoveMode | The method of interpolation to use when moving. |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
AddTranslateOffset
public void AddTranslateOffset(Sansar.Vector positionOffset)Sets the position of this Mover to a target Local Space position.
| Parameter | Type | Description |
|---|---|---|
positionOffset | Sansar.Vector | The local space position offset. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddTranslateOffset(
Sansar.Vector positionOffset,
Action<Sansar.Script.OperationCompleteEvent> handler
)Sets the position of this Mover to a target Local Space position.
| Parameter | Type | Description |
|---|---|---|
positionOffset | Sansar.Vector | The local space position offset. |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddTranslateOffset(
Sansar.Vector positionOffset,
double timeInSeconds,
MoveMode interpolationMode
)Translate the Mover to the target Local Space position over time.
| Parameter | Type | Description |
|---|---|---|
positionOffset | Sansar.Vector | The local space position offset. |
timeInSeconds | double | The time in seconds to move over. |
interpolationMode | MoveMode | The method of interpolation to use when moving. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void AddTranslateOffset(
Sansar.Vector positionOffset,
double timeInSeconds,
MoveMode interpolationMode,
Action<Sansar.Script.OperationCompleteEvent> handler
)Translate the Mover to the target Local Space position over time.
| Parameter | Type | Description |
|---|---|---|
positionOffset | Sansar.Vector | The local space position offset. |
timeInSeconds | double | The time in seconds to move over. |
interpolationMode | MoveMode | The method of interpolation to use when moving. |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
This asynchronous method queues this command then returns. To block until this move command has been executed and completed, pass this method to ScriptBase.WaitFor while in a coroutine.
StopAndClear
public void StopAndClear()Stops the current movement and clears any further movements for this Mover.
Remarks
This method is not enqueued like other operations on the Mover. To block until the operation has executed, pass this method to ScriptBase.WaitFor while in a coroutine.
public void StopAndClear(
Action<Sansar.Script.OperationCompleteEvent> handler
)Stops the current movement and clears any further movements for this Mover.
| Parameter | Type | Description |
|---|---|---|
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
This method is not enqueued like other operations on the Mover. To block until the operation has executed, pass this method to ScriptBase.WaitFor while in a coroutine.
ToString
public override string ToString()A string representation of this object.
Returns: string — A string representation of this object.
Remarks
The format of this string may change between releases.
Used in examples
- MoverExample1.cs
- MoverExample2.cs
- MoverExample3.cs
MoverExample4.cs- ScriptLibrary/Scene/KeyframedMotion.cs
- ScriptLibrary/Scene/Mover.cs
Generated from the Sansar 47.10.0 client ScriptApi snapshot.