AAIController::StopMovement
#include "AIController.h"
Access: public
Specifiers: virtualoverrideAIMODULE_API
Description
Immediately aborts any active move request and stops path following. The current path and request ID are discarded.
Caveats & Gotchas
- • StopMovement cancels the path-following request but does not stop the pawn's movement component momentum — the pawn may continue sliding on physics-driven characters. Call GetPawn()->GetMovementComponent()->StopMovementImmediately() if an instant halt is required.
- • Calling this from within OnMoveCompleted is safe but redundant — the move is already finished at that point.
Signature
virtual void StopMovement() override; Return Type
void Example
Stop movement when a player is spotted C++
void AMyAIController::OnPlayerSpotted(APawn* Player)
{
StopMovement();
SetFocus(Player);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?