RealDocs

APawn::UpdateNavAgent

function Engine Since 4.0
#include "GameFramework/Pawn.h"
Access: public

Description

Refreshes the `MovementComponent`'s nav agent properties so the navigation system uses the pawn's current collision extents and step-height settings.

Caveats & Gotchas

  • Must be called after modifying the movement component's `NavAgentProps` at runtime (e.g., changing CrouchHalfHeight), otherwise the navmesh query will use stale extents.
  • This is called automatically during `PostInitializeComponents`; you only need to call it manually when properties change after initialisation.

Signature

void UpdateNavAgent()

Return Type

void

Example

Refresh nav agent after resizing collision C++
// After dynamically changing the capsule half-height at runtime
GetCapsuleComponent()->SetCapsuleHalfHeight(NewHeight);
UpdateNavAgent();

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.