RealDocs

APawn::GetNavAgentLocation

function Engine Blueprint Since 4.6
#include "GameFramework/Pawn.h"
Access: public Specifiers: virtualoverrideUFUNCTIONBlueprintCallable

Description

Returns the pawn's location as seen by the navigation system — the actor location offset downward by BaseEyeHeight. This represents the approximate foot/base position used for pathfinding queries.

Caveats & Gotchas

  • The default implementation subtracts BaseEyeHeight along Z, not the capsule half-height. For standard Characters this means the nav location is slightly above the actual floor position — use the CharacterMovementComponent's UpdatedComponent base when floor precision matters.
  • This is an INavAgentInterface override; it is called by the navigation system, not directly by gameplay code. Overriding it incorrectly can break pathfinding for AI controllers that possess this pawn.

Signature

virtual FVector GetNavAgentLocation() const override

Return Type

FVector

Example

Spawn a nav debug sphere at the agent location C++
// In a debug draw helper function
FVector AgentLoc = MyPawn->GetNavAgentLocation();
DrawDebugSphere(GetWorld(), AgentLoc, 20.f, 8, FColor::Green, false, 2.f);

Version History

Introduced in: 4.6

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.