Skip to main content

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​

IHasUnityContext

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​

KillCommand()​

Cancel the current movement command.

void KillCommand()

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​

NameTypeDescription
pathCinemachinePathBaseThe 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​

NameTypeDescription
pathCinemachinePathBaseThe Cinemachine path to follow.
acceptableRadiusfloatHorizontal 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​

NameTypeDescription
pathCinemachinePathBaseThe Cinemachine path to follow.
acceptableRadiusfloatHorizontal distance from the path end at which the actor is considered to have arrived.
minLookAheadDistancefloatMinimum steering preview distance in meters.
maxLookAheadDistancefloatMaximum steering preview distance in meters.
lookAheadTimefloatPreview time in seconds, multiplied by horizontal speed. Zero yields a fixed minimum preview.
curveSensitivityfloatHow 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​

NameTypeDescription
locationVector3The 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​

NameTypeDescription
locationVector3The target world-space position.
acceptableRadiusfloatHorizontal 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​

NameTypeDescription
transformTransformThe 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​

NameTypeDescription
transformTransformThe transform to follow.
acceptableRadiusfloatHorizontal distance at which the actor is considered to have arrived.

PauseCommand()​

Pause (not cancel) the current movement command.

void PauseCommand()

ResumeCommand()​

Resume the paused movement command.

void ResumeCommand()
  • Examples
  • Remarks
  • Methods
    • KillCommand()
    • MoveAlongPath(CinemachinePathBase)
    • MoveAlongPath(CinemachinePathBase, float)
    • MoveAlongPath(CinemachinePathBase, float, float, float, float, float)
    • MoveToLocation(Vector3)
    • MoveToLocation(Vector3, float)
    • MoveToLocation(Transform)
    • MoveToLocation(Transform, float)
    • PauseCommand()
    • ResumeCommand()