UActorComponent::OnComponentDeactivated
#include "Components/ActorComponent.h"
Access: public
Specifiers: UPROPERTYBlueprintAssignable
Description
Dynamic multicast delegate fired whenever the component is deactivated. Broadcasts the deactivated component.
Caveats & Gotchas
- • Fires inside Deactivate() after bIsActive is set to false, so IsActive() returns false inside callbacks. This is important if your callback calls Activate() — it will immediately re-activate.
- • This delegate is NOT fired when the component is destroyed — use the component's OnComponentDestroyed delegate or the owning actor's EndPlay for destroy-time cleanup.
- • Sparse delegate allocation: memory is not allocated until the first binding is added, so checking OnComponentDeactivated.IsBound() before broadcasting from subclasses is safe and cheap.
Signature
UPROPERTY(BlueprintAssignable, Category = "Components|Activation")
FActorComponentDeactivateSignature OnComponentDeactivated; Examples
Bind in Blueprint (description) text
// In Blueprint: select the component, go to its Details panel Events section, click '+' next to OnComponentDeactivated to auto-create the event node. Bind in C++ C++
MyComponent->OnComponentDeactivated.AddDynamic(this, &AMyActor::HandleComponentDeactivated);
void AMyActor::HandleComponentDeactivated(UActorComponent* Component)
{
UE_LOG(LogTemp, Log, TEXT("%s deactivated"), *Component->GetName());
} Tags
Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?