Interface IMoveCommandInvoker
Invoker contract for movement commands: issues a destination to an actor and allows the caller to pause, resume, or cancel that navigation independently.
public interface IMoveCommandInvoker : IHasUnityContext
Implements
Examples
// A traffic process retrieves the invoker once at initialisation:
IMoveCommandInvoker invoker = actorGameObject.GetComponent();
// Issue a movement goal (idempotent — safe to call every frame from a BT node):
invoker.MoveToLocation(waypointPosition);
// Pause at a stop line while waiting for signal clearance,
// without discarding the current destination:
invoker.PauseCommand();
// Resume toward the same destination once the signal clears:
invoker.ResumeCommand();
// Permanently cancel when the actor's path is invalidated or the actor despawns:
invoker.KillCommand();
Remarks
The pause/resume split exists because traffic processes (anti-collision, stopline) need to temporarily hold an actor without discarding its destination. PauseCommand stops physics immediately while retaining the goal; ResumeCommand continues toward it when the hold condition clears. KillCommand permanently cancels and clears the goal.
The acceptableRadius overloads use a 2D XZ distance check so that height
differences on kerbs or slopes do not prevent arrival from being detected.
Methods
MoveAlongPath(CinemachinePathBase)
Issues a command to follow a Cinemachine spline path from start to end using the default arrival radius at the path's final position.
void MoveAlongPath(CinemachinePathBase path)
Parameters
| Name | Type | Description |
|---|---|---|
path | CinemachinePathBase | The Cinemachine path to follow. |
MoveAlongPath(CinemachinePathBase, float)
Issues a command to follow a Cinemachine spline path with a custom XZ arrival radius at the path's final position.
void MoveAlongPath(CinemachinePathBase path, float acceptableRadius)
Parameters
| Name | Type | Description |
|---|---|---|
path | CinemachinePathBase | The Cinemachine path to follow. |
acceptableRadius | float | Horizontal distance from the path end at which the actor is considered to have arrived. |
MoveAlongPath(CinemachinePathBase, float, float, float, float, float)
Issues a command to follow a Cinemachine spline path using caller-supplied steering look-ahead settings, which belong to the path follower rather than the invoker.
void MoveAlongPath(CinemachinePathBase path, float acceptableRadius, float minLookAheadDistance, float maxLookAheadDistance, float lookAheadTime, float curveSensitivity)
Parameters
| Name | Type | Description |
|---|---|---|
path | CinemachinePathBase | The Cinemachine path to follow. |
acceptableRadius | float | Horizontal distance from the path end at which the actor is considered to have arrived. |
minLookAheadDistance | float | Minimum steering preview distance in meters. |
maxLookAheadDistance | float | Maximum steering preview distance in meters. |
lookAheadTime | float | Preview time in seconds, multiplied by horizontal speed. Zero yields a fixed minimum preview. |
curveSensitivity | float | How strongly upcoming heading changes shorten the preview; zero disables curve adjustment. |
MoveToLocation(Vector3)
Issues a move command to a fixed world-space position using the default arrival radius.
void MoveToLocation(Vector3 location)
Parameters
| Name | Type | Description |
|---|---|---|
location | Vector3 | The target world-space position. |
MoveToLocation(Vector3, float)
Issues a move command to a fixed world-space position with a custom XZ arrival radius.
void MoveToLocation(Vector3 location, float acceptableRadius)
Parameters
| Name | Type | Description |
|---|---|---|
location | Vector3 | The target world-space position. |
acceptableRadius | float | Horizontal distance at which the actor is considered to have arrived. |
MoveToLocation(Transform)
Issues a move command that tracks a moving transform, re-evaluating the goal each tick so the actor follows if the target moves.
void MoveToLocation(Transform transform)
Parameters
| Name | Type | Description |
|---|---|---|
transform | Transform | The transform to follow. |
MoveToLocation(Transform, float)
Issues a move command that tracks a moving transform with a custom XZ arrival radius.
void MoveToLocation(Transform transform, float acceptableRadius)
Parameters
| Name | Type | Description |
|---|---|---|
transform | Transform | The transform to follow. |
acceptableRadius | float | Horizontal distance at which the actor is considered to have arrived. |