UCharacterMovementComponent::SetGroupsToAvoidMask
#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)); See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?