How to "expose on spawn" a constructor param in C++?

Did you see that I mention the word CDO (which stands for Class Default Object, here my own 5 sec google search)? Because if you did and searched what it means and why it’s being used, it should be understandable why you can’t re-run the constructor. There is other functions that get called right after the constructor to initialize some stuff that is needed for the editor and the whole reflection system. One of these hidden functions also creates Blueprints. So, in that sense, if you call a “Blueprint Constructor”, you call one of these post functions and not the C++ Constructor. Therefore, to get the same behavior in C++, you should implement a function that is exactly doing this. You might be able to find the function that is called in Blueprints, but last time I checked you shouldn’t use it, because it comes with boilerplate code for Blueprints and if you make a Blueprint and change your Construction Script (which if you notice is not even called Constructor on purpose) things get even worse.

1 Like