RealDocs

UCharacterMovementComponent::SetGroupsToAvoidMask

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

Description

Sets the mask of avoidance groups this character should actively avoid during RVO avoidance calculations.

Caveats & Gotchas

  • GroupsToIgnore takes priority — any group present in both GroupsToIgnore and GroupsToAvoid is treated as ignored, not avoided.
  • Only affects neighbor filtering; it doesn't enable avoidance itself — call SetAvoidanceEnabled(true) separately.

Signature

void SetGroupsToAvoidMask(const FNavAvoidanceMask& GroupMask)

Parameters

Name Type Description Default
GroupMask const FNavAvoidanceMask& The mask of avoidance groups this character should actively avoid.

Return Type

void

Example

Avoid a specific group of agents C++
GetCharacterMovement()->SetGroupsToAvoidMask(FNavAvoidanceMask(1 << 1));

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.