RealDocs

AActor::FinishAndRegisterComponent

function Engine Since 4.0
#include "GameFramework/Actor.h"
Access: public

Description

Completes component setup by adding it to the actor's serialized components array and registering it with the world. Called at the end of CreateDefaultSubobject-style construction paths.

Caveats & Gotchas

  • This adds the component to the OwnedComponents and BlueprintCreatedComponents lists — do not call it on components that were already registered through another path or they will appear twice.
  • Must only be called during an actor's construction phase (constructor or OnConstruction). Calling it after BeginPlay can produce components that are partially initialized and unserialized.

Signature

ENGINE_API void FinishAndRegisterComponent(UActorComponent* Component);

Parameters

Name Type Description Default
Component UActorComponent* The component to finalize and register.

Return Type

void

Example

Used internally after CreateComponentFromTemplate C++
// Typical internal pattern (simplified):
UActorComponent* NewComp = CreateComponentFromTemplate(TemplateComp, DesiredName);
if (NewComp)
{
    FinishAndRegisterComponent(NewComp);
}

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.