UAbilitySystemComponent::SetAvatarActor_Direct
#include "AbilitySystemComponent.h"
Access: public
Description
Directly sets the AvatarActor pointer without triggering the full actor-info refresh that SetAvatarActor performs. Used internally or when you need surgical control over the cached actor reference.
Caveats & Gotchas
- • Does not refresh AbilityActorInfo — movement component, mesh, anim instance caches remain stale until InitAbilityActorInfo or RefreshAbilityActorInfo is called.
- • Prefer SetAvatarActor (without _Direct) for normal possession flows; the _Direct variant is an escape hatch that bypasses safety logic.
Signature
UE_API void SetAvatarActor_Direct(AActor* NewAvatarActor) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| NewAvatarActor | AActor* | The physical actor in the world to set as the avatar. | — |
Return Type
void Example
Low-level avatar pointer update C++
// Internal use: update the cached pointer then manually refresh info
ASC->SetAvatarActor_Direct(NewPawn);
ASC->RefreshAbilityActorInfo(); Version History
Introduced in: 4.15
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?