As of 4.9, we now have the Construct Object from Class node. However, as it is now, this node is incredibly difficult to use in Blueprint, especially if the object to be spawned was created in Blueprint. I suggest improving the usability of baser objects in Blueprint. Below are my extended thoughts.
First, when creating an object through any other means, we never have to specify an owner. If an object’s reference is never saved, it should be scoped to the function in which it lives. Otherwise, the object lives as long as it is referenced. In any other case, rather than specifying an owner, we simply save a reference variable when we want to keep the object around. In the current implementation, I’m not even entirely sure how to maintain objects only during the life of a function.
We have no way to call a constructor for classes derived from UObject that are created in Blueprint. We can create and call a custom Init function, but that’s pretty clunky.
We have no way to specify static/shared/class variables and functions. We can add an instance to a custom GameInstance, but then systems would be coupled to that game instance.
Ideally, I’d like to be able to create a Message object in Blueprint that has a category and a static/shared list of categories and their subscribers. On its construction, it would send itself to each actor subscribed to the message’s category.
Yes, C++ can do these things. But, the same can be said for everything.