StaticConstructObject_Internal

Create a new instance of an object.

Windows
MacOS
Linux

Deprecated

  • Use version that takes parameter struct

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/UObject/UObjectGlobals.h

Include

#include "UObject/UObjectGlobals.h"

Source

/Engine/Source/Runtime/CoreUObject/Private/UObject/UObjectGlobals.cpp

Syntax

UObject * StaticConstructObject_Internal
(
    const UClass * Class,
    UObject * InOuter,
    FName Name,
    EObjectFlags SetFlags,
    EInternalObjectFlags InternalSetFlags,
    UObject * Template,
    bool bCopyTransientsFromClassDefaults,
    struct FObjectInstancingGraph * InstanceGraph,
    bool bAssumeTemplateIsArchetype,
    UPackage * ExternalPackage
)

Remarks

Create a new instance of an object. The returned object will be fully initialized. If InFlags contains RF_NeedsLoad (indicating that the object still needs to load its object data from disk), components are not instanced (this will instead occur in PostLoad()). The different between StaticConstructObject and StaticAllocateObject is that StaticConstructObject will also call the class constructor on the object and instance any components.

Returns

A pointer to a fully initialized object of the specified class.

Parameters

Parameter

Description

Class

The class of the object to create

InOuter

The object to create this object within (the Outer property for the new object will be set to the value specified here).

Name

The name to give the new object. If no value (NAME_None) is specified, the object will be given a unique name in the form of ClassName_#.

SetFlags

The ObjectFlags to assign to the new object. some flags can affect the behavior of constructing the object.

InternalSetFlags

The InternalObjectFlags to assign to the new object. some flags can affect the behavior of constructing the object.

Template

If specified, the property values from this object will be copied to the new object, and the new object's ObjectArchetype value will be set to this object. If nullptr, the class default object is used instead.

bInCopyTransientsFromClassDefaults

If true, copy transient from the class defaults instead of the pass in archetype ptr (often these are the same)

InstanceGraph

Contains the mappings of instanced objects and components to their templates

bAssumeTemplateIsArchetype

If true, Template is guaranteed to be an archetype

ExternalPackage

Assign an external Package to the created object if non-null

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss