There are serval posts talking about FObjectInitializer in UE4, but I found out the default template of C++ in UE5 no longer using:AClassName(const FObjectInitializer& ObjectInitializer = ObjectInitializer::Get()) anymore.
I want to know if there is any difference between:
except the first one can accept Parameters from drived class.
Because I saw most of the engine class has default const FObjectInitializer& ObjectInitializer = ObjectInitializer::Get(), so is that means it doesn’t matter?
I can just use CreateDefaultSubobject<>() rather than ObjectInitializer.CreateDefaultSubobject<>()
Technically the ObjectInitializer version of constructor is deprecated. At least that’s what the documentation says, but I don’t think there is an alternative for say DoNotCreateDefaultSubobject so in that case you still need to use the constructor with ObjectInitializer version. You are also forced to use the ObjectInitializer version if any of the parent classes uses it (otherwise code won’t compile).