Always need to restart editor to see change in code

Basically, I’m trying to make a c++ plugin but every time I try to do a modification in the *.h file I have to reboot the unreal editor to see the change.

Example: If I create a new variable, I’ll have to compile in VB, close the editor and reopen the editor to see the variable in my BP. If I want to change the comment, I have to reload the editor again.

What I’ve tried:
Build the editor from VB
Use the compile button in unreal
Compile from VB
Compile using Live coding
Use the developer module (usually crash if I modify the code, won’t crash if I don’t)

Setting used for VB: Debug game, Debug game editor, Development and Developpement Editor

You cannot make header (.h) changes without restarting the editor… it wasn’t supported with hot reload (also don’t use hot reload, it can break/corrupt things) and it isn’t supported by live coding either.

It might be possible in the future as live coding gets further developed but as of right now… use live coding and avoid header changes as much as possible.

There is a reason why even super skilled c++ programmers prefer to prototype in blueprints… it’s just faster for certain things, instant compilation.

1 Like

Adding removing reflection related meta data is not supported under hot reload.

Once compiled the UPROPERTIES and UFUNCTIONS get put in a giant linked list. Hot reload does not rebuild this list.

SO, You cannot add, remove, or modify the size of any reflected variables. And cannot add or remove UFUNCTION() macros. Used to work, but just did not call the new function as it does not exist in the linked liet.

Modifying any reflection related code requires a rebuild / restart.

Add your UFUNCTION() macros, and your void MySignatureFunction(MyVAriables…)… And you can rewrite and hot reload the code for that function. This is done by simply loading the new DLL. with the new code changes. THe existing Editor state is never modified. THe linked lists remain fairly static.