Navigation
API > API/Runtime > API/Runtime/CoreUObject > API/Runtime/CoreUObject/FObjectInitializer
Description
Create optional component or subobject. Optional subobjects will not get created. if a derived class specifies DoNotCreateDefaultSubobject with the subobject name.
| Name | CreateOptionalDefaultSubobject |
| Type | function |
| Header File | /Engine/Source/Runtime/CoreUObject/Public/UObject/UObjectGlobals.h |
| Include Path | #include "UObject/UObjectGlobals.h" |
template<class TReturnType>
TReturnType * CreateOptionalDefaultSubobject
(
UObject * Outer,
FName SubobjectName,
bool bTransient
) const
Parameters
| Name | Remarks |
|---|---|
| TReturnType | class of return type, all overrides must be of this type |
| Outer | outer to construct the subobject in |
| SubobjectName | name of the new component, this will be the same for all instances of this class |
| bTransient | true if the component is being assigned to a transient property |