I found about four different ways to instantiate the object, but not sure if my understanding are clear.
-
NewObject<T>()
function used when we want to make at the instance ofUObject
. For example, it can be any ActorComponents.USomeComponent sc = NewObject<USomeComponent> (class);
-
ConstructObject<T>()
one more way to initUObject
… -
CreateDefaultSubobject<T>()
but using this one function we also can create an instance of any class inherited fromUObject
.
So first question: What is the difference if we can use these functions for one purpose? How and when and why we need to use any of them?
-
SpawnActor<T>()
used for instantiating an object ofAActor
class.
Question two: Is it a fine way to init Actor
's? What is the place in the game when we need to init exactly Actors
? Write, please, any example except for GameMode
.
-
ConstructorHelpers::FObjectFinder<T>()
pretty clear scope of using. To load and set up assets. Can this method be useful in some other place?