RealDocs

AActor::HasNonTrivialUserConstructionScript

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

Description

Returns true if this actor's class has a non-trivial Blueprint User Construction Script — i.e. a construction script that does more than just call the parent.

Caveats & Gotchas

  • The result is determined at class compile time and cached. It reflects the Blueprint graph structure, not whether the construction script actually produces side effects for a given instance.
  • This is used by the engine to decide whether to re-run construction scripts after property changes. Overriding it in C++ to always return false will skip UCS execution for your class, which can improve spawning performance but will break Blueprint actors that rely on their UCS.

Signature

bool HasNonTrivialUserConstructionScript() const

Return Type

bool

Example

Skip expensive setup if no UCS is present C++
if (!MyActor->HasNonTrivialUserConstructionScript())
{
    // Safe to skip deferred component registration overhead
    MyActor->RegisterAllComponents();
}

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.