AAIController::GetCurrentMoveRequestID
#include "AIController.h"
Access: public
Specifiers: AIMODULE_APIconst
Description
Returns the FAIRequestID of the movement request currently being processed by the PathFollowingComponent. Use this to correlate an active move with a future OnMoveCompleted callback.
Caveats & Gotchas
- • Returns FAIRequestID::InvalidRequest if no move is active or if PathFollowingComponent is null. Always check validity before using the ID with PauseMove or ResumeMove.
- • The ID is stable for the lifetime of one move request. Once the move completes or is cancelled, a subsequent MoveToActor or MoveToLocation call will return a different ID.
Signature
FAIRequestID GetCurrentMoveRequestID() const; Return Type
FAIRequestID Example
Cache the active move ID for later use C++
MoveToActor(TargetActor);
CachedRequestID = GetCurrentMoveRequestID();
// Later — pause only if our move is still active
if (CachedRequestID == GetCurrentMoveRequestID())
{
PauseMove(CachedRequestID);
} See Also
Tags
Version History
Introduced in: 4.7
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?