AAIController::PreparePathfinding
Deprecated: Use FindPathForMoveRequest() for adjusting Query or BuildPathfindingQuery() for getting one.
#include "AIController.h"
Access: public
Specifiers: virtualdeprecated
Description
Deprecated since UE 4.13. Formerly prepared a pathfinding query before it was submitted to the navigation system. Replaced by the BuildPathfindingQuery + FindPathForMoveRequest pair.
Caveats & Gotchas
- • Calling this function will trigger a UE_DEPRECATED_FORGAME compiler warning. Remove all overrides and call sites and migrate to FindPathForMoveRequest for query adjustment or BuildPathfindingQuery for query construction.
- • If you override this in a subclass that was written before 4.13, your override will no longer be called by the engine — the new path runs through FindPathForMoveRequest.
Signature
virtual bool PreparePathfinding(const FAIMoveRequest& MoveRequest, FPathFindingQuery& Query) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| MoveRequest | const FAIMoveRequest& | The move request describing the goal. | — |
| Query | FPathFindingQuery& | Pathfinding query to prepare. | — |
Return Type
bool Example
Migration to FindPathForMoveRequest C++
// OLD (deprecated):
// virtual bool PreparePathfinding(const FAIMoveRequest& Req, FPathFindingQuery& Q) override { ... }
// NEW: override FindPathForMoveRequest instead
virtual void AMyAIController::FindPathForMoveRequest(
const FAIMoveRequest& MoveRequest,
FPathFindingQuery& Query,
FNavPathSharedPtr& OutPath) const override
{
// Modify Query here, then call super
Super::FindPathForMoveRequest(MoveRequest, Query, OutPath);
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | deprecated | Deprecated since 4.13 via UE_DEPRECATED_FORGAME. |
Feedback
Was this helpful?