RealDocs

UActorComponent::HasBeenCreated

function Engine Since unknown
#include "Components/ActorComponent.h"
Access: public Specifiers: inline

Description

Returns true after OnCreatedComponent has been called and before OnDestroyedComponent has been called. Use this to confirm the component has passed the creation notification stage.

Caveats & Gotchas

  • This flag is set by the engine before the component reaches InitializeComponent or BeginPlay, so it being true does not imply the component is ready for gameplay use — check HasBeenInitialized() for that.
  • Do not confuse with HasBeenInitialized(): a component may have been created (bHasBeenCreated == true) but not yet initialized if InitializeComponent has not run, which happens when bWantsInitializeComponent is false.

Signature

bool HasBeenCreated() const { return bHasBeenCreated; }

Return Type

bool

Example

Defensive check before accessing component data C++
if (MyComponent && MyComponent->HasBeenCreated())
{
    // Safe to query creation-time state
    UE_LOG(LogGame, Log, TEXT("Component created: %s"), *MyComponent->GetName());
}

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.