RealDocs

UActorComponent::ShouldIncrementalPreRegister

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

Description

Returns whether PreRegisterComponentWithWorld should be called for this component when its level is being added to the world incrementally. Override to opt into pre-registration for expensive component setup that benefits from streaming time-slicing.

Caveats & Gotchas

  • The base implementation returns false; you must explicitly override and return true to participate in incremental level streaming. Only components that perform heavy OnPreRegister work benefit from opting in.
  • PreRegisterComponentWithWorld is only invoked when this returns true; returning true incorrectly (for a lightweight component) adds scheduling overhead to the streaming pipeline without any gain.

Signature

ENGINE_API virtual bool ShouldIncrementalPreRegister(UWorld* WorldContext) const;

Parameters

Name Type Description Default
WorldContext UWorld* The world the level is being added to.

Return Type

bool

Example

Opting a heavy component into incremental pre-registration C++
bool UMyHeavyComponent::ShouldIncrementalPreRegister(UWorld* WorldContext) const
{
    // Only do incremental pre-register when streaming large open-world levels
    return WorldContext && WorldContext->IsGameWorld();
}

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.