RealDocs

UActorComponent::CreationMethod

property Engine Since 4.0
#include "Components/ActorComponent.h"
Access: public Specifiers: UPROPERTY

Description

Describes how this component instance was created: natively in C++ code, via a Blueprint simple construction script, via a user construction script, or as a native child actor.

Caveats & Gotchas

  • Components created via construction scripts (EComponentCreationMethod::SimpleConstructionScript or UserConstructionScript) are re-created when the actor runs RerunConstructionScripts — native (C++) components are not. If you store state on a component, be aware it may be destroyed and recreated in the editor.
  • The value is serialized and used internally to determine re-registration behavior. Avoid modifying it at runtime; it is set by the engine during component creation.

Signature

UPROPERTY()
EComponentCreationMethod CreationMethod

Example

Check if a component was created natively or via Blueprint C++
if (MyComp->CreationMethod == EComponentCreationMethod::Native)
{
	// Safe to assume this component persists across construction script reruns
}
else if (MyComp->CreationMethod == EComponentCreationMethod::SimpleConstructionScript)
{
	// Component was added in the Blueprint editor SCS
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.