Navigation
Unreal Engine C++ API Reference > Runtime > CoreUObject > UObject > NewObject
References
Module | CoreUObject |
Header | /Engine/Source/Runtime/CoreUObject/Public/UObject/UObjectGlobals.h |
Include | #include "UObject/UObjectGlobals.h" |
template<class T>
FUNCTION_NON_NULL_RETURN_START T * NewObject
(
UObject * Outer,
const UClass * Class,
FName Name,
EObjectFlags Flags,
UObject * Template,
bool bCopyTransientsFromClassDefaults,
FObjectInstancingGraph * InInstanceGraph,
UPackage * ExternalPackage
)
Remarks
Convenience template for constructing a gameplay object a pointer of type T to a new object of the specified class
Parameters
Name | Description |
---|---|
Outer | the outer for the new object. If not specified, object will be created in the transient package. |
Class | the class of object to construct |
Name | the name for the new object. If not specified, the object will be given a transient name via MakeUniqueObjectName |
Flags | the object flags to apply to the new object |
Template | the object to use for initializing the new object. If not specified, the class's default object will be used |
bCopyTransientsFromClassDefaults | if true, copy transient from the class defaults instead of the pass in archetype ptr (often these are the same) |
InInstanceGraph | contains the mappings of instanced objects and components to their templates |
ExternalPackage | Assign an external Package to the created object if non-null |