How to instantiate a blueprint object from a C++ script?

In general, UE4 uses an alternative C++ approach, which I also like in general C++ (constructor-arguments end up always causing tons of exception heartache.)

  1. Create a “blank” instance of some object.
  2. Configure the object.
  3. Actually start using the object.

The benefit of this is that you never end up with exceptions in constructors, causing half-initialized object nightmares, and a lot of the very wordy boilerplate template stuff needed to support “accurate” lifetime in modern C++ just falls away.

Blueprints then take this to the next level; part 2) is data-driven, using the Unreal reflection system, not just a separate C++ step.

1 Like