RealDocs

APawn::SetCanAffectNavigationGeneration

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

Description

Controls whether this pawn instance participates in runtime navmesh generation. By default pawns do not affect navigation; set this to true when the pawn's physical volume should carve or modify the navmesh at runtime.

Caveats & Gotchas

  • • Has no visible effect unless runtime navigation generation is enabled in the project (RecastNavMesh → RuntimeGeneration = Dynamic or LargeScaleDynamic). In static-baked nav projects the call is silently ignored.
  • • You must also override UpdateNavigationRelevance() to propagate the flag to the relevant components (e.g., capsule or mesh). Without that override, the components still won't mark themselves as nav-relevant.
  • • The AdvancedDisplay metadata hides bForceUpdate from the Blueprint node by default; expose it only when you need to force a rebuild mid-frame.

Signature

void SetCanAffectNavigationGeneration(bool bNewValue, bool bForceUpdate = false)

Parameters

Name Type Description Default
bNewValue bool Whether this pawn should be considered when generating the navmesh. —
bForceUpdate bool If true, forces an immediate navigation update even when the value didn't change. false

Return Type

void

Example

Enable nav generation for a large creature pawn C++
void ACreaturePawn::PostInitializeComponents()
{
	Super::PostInitializeComponents();
	// This creature is large enough to carve the navmesh at runtime
	SetCanAffectNavigationGeneration(true);
}

Version History

Introduced in: 4.14

Version Status Notes
5.6 stable —

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.