UAbilitySystemComponent::OnRep_OwningActor
#include "AbilitySystemComponent.h"
Access: public
Specifiers: UFUNCTION
Description
RepNotify called on clients when the owning or avatar actor reference replicates. Re-initializes the ASC's actor info so abilities can access the updated pawn.
Caveats & Gotchas
- • Both OwnerActor and AvatarActor use this same RepNotify — a single function handles both UPROPERTY replication callbacks.
- • Do not call this directly; it is invoked automatically by the replication system. Override it only if you need to react to owner/avatar actor changes on the client.
Signature
void OnRep_OwningActor() Return Type
void Example
Overriding to update a local cache when the avatar changes C++
void UMyAbilitySystemComponent::OnRep_OwningActor()
{
Super::OnRep_OwningActor();
// Refresh cached pawn reference after replication
CachedPawn = Cast<AMyCharacter>(GetAvatarActor());
} Tags
Version History
Introduced in: 4.15
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?