AAIController::RequestMove
#include "AIController.h"
Access: public
Specifiers: virtualAIMODULE_API
Description
Hands an already-computed path to the PathFollowingComponent and starts movement. Returns a request ID that can be used to pause, resume, or abort this specific move.
Caveats & Gotchas
- • This is the low-level path submission step. If pathfinding needs to happen first, call MoveTo() or MoveToActor() instead — those compute the path and then call RequestMove internally.
- • The returned FAIRequestID is INVALID if PathFollowingComponent is null or if no pawn is possessed. Always check validity before storing the ID.
Signature
virtual FAIRequestID RequestMove(const FAIMoveRequest& MoveRequest, FNavPathSharedPtr Path); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| MoveRequest | const FAIMoveRequest& | Describes the move destination, acceptance radius, filter class, and other move parameters. | — |
| Path | FNavPathSharedPtr | A pre-computed navigation path to follow. | — |
Return Type
FAIRequestID Example
Submit a pre-built path C++
FAIMoveRequest MoveReq;
MoveReq.SetGoalLocation(TargetLocation);
MoveReq.SetAcceptanceRadius(50.f);
FAIRequestID RequestID = MyAIController->RequestMove(MoveReq, PrebuiltPath);
if (RequestID.IsValid())
{
CurrentMoveID = RequestID;
} See Also
Tags
Version History
Introduced in: 4.7
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?