FObjectInitializer::CreateDefaultSubobject

Create a component or subobject

Windows
MacOS
Linux

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 * CreateDefaultSubobject
(
    UObject * Outer,
    FName SubobjectFName,
    UClass * ReturnType,
    UClass * ClassToCreateByDefault,
    bool bIsRequired,
    bool bIsTransient
) const

Remarks

Create a component or subobject

Parameters

Parameter

Description

TReturnType

class of return type, all overrides must be of this type

TClassToConstructByDefault

if the derived class has not overridden, create a component of this type (default is TReturnType)

Outer

outer to construct the subobject in

SubobjectName

name of the new component

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

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