RealDocs

AActor::PostRegisterAllComponents

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

Description

Called after all components have been registered with the world. This is the last function called in all actor registration cases — both editor and gameplay — making it the safest place to run logic that depends on all components being ready.

Caveats & Gotchas

  • bHasRegisteredAllComponents is set to true immediately before this call. Code in this override can safely call HasActorRegisteredAllComponents() and expect true.
  • This is called in the editor for all placed actors; avoid gameplay-only assumptions. Also called after re-registration (e.g., after UnregisterAllComponents/RegisterAllComponents), so the override must be idempotent if it mutates actor state.

Signature

ENGINE_API virtual void PostRegisterAllComponents();

Return Type

void

Example

Cache component references after full registration C++
void AMyActor::PostRegisterAllComponents()
{
    Super::PostRegisterAllComponents();
    // All components are registered; safe to query the hierarchy
    CachedMesh = FindComponentByClass<UStaticMeshComponent>();
}

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.