UActorComponent::OnDestroyedFromReplication
#include "Components/ActorComponent.h"
Access: public
Description
Called on clients when a replicated component is removed from the network. Part of the IInterface_ActorSubobject protocol — handles teardown of the component's replicated state on the receiving end.
Caveats & Gotchas
- • Only fires on clients (or listen-server proxies) — never on the authoritative server. If you override it to release resources, ensure your cleanup logic is safe to call in a non-authority context.
- • This is paired with OnCreatedFromReplication. Both are internal replication hooks; override them only if your component manages replicated subobjects or needs custom teardown on the client side.
Signature
ENGINE_API void OnDestroyedFromReplication() Return Type
void Example
Cleaning up client-side state when a replicated component is removed C++
void UMyReplicatedComponent::OnDestroyedFromReplication()
{
// Release any client-only resources tied to this component's replicated lifetime
ClientSideParticleSystem = nullptr;
// Always call Super — it handles core replication teardown
Super::OnDestroyedFromReplication();
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?