AActor::OnRep_Instigator
#include "GameFramework/Actor.h"
Access: public
Specifiers: UFUNCTIONvirtual
Description
Called on clients when the Instigator property is replicated. Override to react to changes in which pawn caused this actor's damage or gameplay events.
Caveats & Gotchas
- • Instigator may be null when this fires if the pawn has not yet been replicated to the client — always null-check before use.
- • This is virtual but not BlueprintImplementableEvent; to handle it in Blueprint you must call a custom event from the C++ override.
- • The base class implementation is empty, so calling Super::OnRep_Instigator() is safe but unnecessary.
Signature
ENGINE_API virtual void OnRep_Instigator() Return Type
void Example
React to instigator replication on client C++
void AMyProjectile::OnRep_Instigator()
{
Super::OnRep_Instigator();
if (APawn* Pawn = GetInstigator())
{
// Tint the projectile to the instigator's team color
ApplyTeamColor(Pawn);
}
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?