C++ changes in editor

If parameters are changed in the editor and then accessed in the construction script for blueprint actors, the changes are reflected live ( before play is pressed ). I falsely assumed the same behavior would happen in a c++ constructor, but it seems the constructor is only fired when loading the level. How do i create behavior in c++ that mimics the blueprint construction script?

Exactly the information I was looking for. Thanks.

Constructor is triggered when engine is loading it is used to construct class default object (CDO) which contains default, so you should not have any game play code in constructor and use events only or else you gonna have crash or some strange behaviors.

The construction script is fired in OnConstruction event… more precisely ExecuteConstruction function which calls both OnConstruction and construction script, construction script is seem to be called first looking in the code

But There lot bigger selection of editor related events in C++ and functions that alters actor behavior in editor which you can override (for example once that start with Editor* :wink: but there more), i recommend you to look up API reference:

Just remember that some functions are editor only and you need to place them in #if WITH_EDITOR code here #endif or else you code wont build on packaging where editor API are inaccessible

It’s important to understand that your C++ code is technically extends engine code, there so nothing impossible in there, your enigne module (because you writing module that is loaded to engine) has same privligies as any other engine module in the engine it self, you can call every bit of engine and editor itself stuff that blueprints can only dream about, it’s just matter how painful to use it is. In some cases it easier to use blueprints, for example in C++ it easier to talk with Slate directly then talk to UMG which is just Slate wrapper for blueprints. There is some things that are inaccessible from your engine module that you making (classes with MinimalAPI specifier which can be access only from module that contains it), but still you can modify engine code it self and remove MinimalAPI. What i want to say is that anything you see in editor is in engine code and your code can hook to it or call same action (or else it a mess like current?/old sound system in UE4 :p).