AAIController::IsFollowingAPath
#include "AIController.h"
Access: public
Specifiers: virtualoverrideAIMODULE_APIconst
Description
Returns true if the PathFollowingComponent currently has an active path being followed. Use this to check whether the AI is in motion before issuing a new move request.
Caveats & Gotchas
- • Returns false when movement is paused via PauseMove, even though a path still exists internally. If you need to distinguish paused-vs-idle-vs-moving, check GetMoveStatus() instead.
- • A true return does not guarantee forward progress — the pawn may be stuck or waiting on crowd avoidance. Pair this with a movement timeout if you need to detect stalls.
Signature
virtual bool IsFollowingAPath() const override; Return Type
bool Example
Avoid issuing redundant move requests C++
void AMyAIController::TryMoveToPatrolPoint(FVector PatrolPoint)
{
if (!IsFollowingAPath())
{
MoveToLocation(PatrolPoint);
}
} Tags
Version History
Introduced in: 4.7
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?