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

You don’t need an Init() function, you can lazily configure everything you need in some place like BeginPlay() (actors) or OnConstructed() (widgets.)

It really is a different way to structure C++ code than the current “approved way,” but having used this other method on and off for very long, I would like to offer the observation that it’s often pretty great :slight_smile:

Also, it’s kind-of confusing that Blueprints play two different roles:

  • data-driven class configuration prefabs
  • graph-driven designer-friendly scripting interface

These really are different roles, serving different needs, but I can see how it also makes practical sense to mush them together.

1 Like