Navigation
API > API/Runtime > API/Runtime/CoreUObject > API/Runtime/CoreUObject/UObject > API/Runtime/CoreUObject/UObject/FObjectInitializer > API/Runtime/CoreUObject/UObject/FObjectInitializer/CreateDefaultSubobject
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 |
UObject * CreateDefaultSubobject
(
UObject * Outer,
FName SubobjectFName,
const UClass * ReturnType,
const UClass * ClassToCreateByDefault,
bool bIsRequired,
bool bIsTransient
) const
Remarks
Create a component or subobject that will be instanced inside all instances of this class.
Parameters
| Name | Description |
|---|---|
| Outer | outer to construct the subobject in |
| SubobjectName | name of the new component |
| ReturnType | class of return type, all overrides must be of this type |
| ClassToConstructByDefault | if the derived class has not overridden, create a component of this type |
| bIsRequired | true if the component is required and will always be created even if DoNotCreateDefaultSubobject was specified. |
| bIsTransient | true if the component is being assigned to a transient property |