UActorComponent::OnComponentActivated
#include "Components/ActorComponent.h"
Access: public
Specifiers: UPROPERTYBlueprintAssignable
Description
Dynamic multicast delegate fired whenever the component is activated. Broadcasts the activated component and whether it was a reset activation.
Caveats & Gotchas
- • Declared as a sparse delegate (DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_TwoParams), meaning it doesn't allocate memory until at least one binding exists — be aware that binding from C++ requires using the broadcast functions correctly.
- • Fires after the bIsActive flag is set to true, so IsActive() returns true inside delegate callbacks.
- • Not fired during component construction or BeginPlay's auto-activation unless Activate() is explicitly called. Components with bAutoActivate=true call Activate() during RegisterComponent, which does fire this delegate.
Signature
UPROPERTY(BlueprintAssignable, Category = "Components|Activation")
FActorComponentActivatedSignature OnComponentActivated; Example
Bind in C++ C++
MyComponent->OnComponentActivated.AddDynamic(this, &AMyActor::HandleComponentActivated);
void AMyActor::HandleComponentActivated(UActorComponent* Component, bool bReset)
{
UE_LOG(LogTemp, Log, TEXT("%s activated, reset=%d"), *Component->GetName(), bReset);
} Tags
Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?