UActorComponent::IsPreRegistering
#include "Components/ActorComponent.h"
Access: public
Specifiers: inline
Description
Returns true while this component is in the pre-registering phase — after `RegisterComponent` has been called but before the component is fully registered and its physics/render state has been created.
Caveats & Gotchas
- • This state is transient and typically lasts only a single frame. Code that polls this in a Tick is likely incorrect — use the registration callbacks (`OnRegister`, `CreateRenderState_Concurrent`) instead.
- • Pre-registering and pre-registered are two distinct states. `IsPreRegistering` is true during the transition; `IsPreRegistered` is true after the pre-pass completes but before final registration.
Signature
inline bool IsPreRegistering() const Return Type
bool Example
Assert correct state during component initialization C++
void UMyComponent::OnRegister()
{
// IsPreRegistering should be true here during the registration process
ensureMsgf(!IsPreRegistering() || GetOwner() != nullptr,
TEXT("Component registering without a valid owner"));
Super::OnRegister();
} Tags
Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?