Download

Updating C++ class causes child Blueprint class to lose references to parent variables and functions

I have a C++ class for my character base which has various functions and variables, and then a Blueprint child class that references these variables and calls these functions in its event graph. When I change any code in the C++ class and then save and compile, the Blueprint class shows errors for all of the function calls to the parent class’ functions and references to its variables. It happens even if the C++ edits are to things totally unrelated to anything called in event graph. When I delete those references from the event graph and then put them back into the event graph, everything works fine. But it’s going to get very old having to delete and replace all my functions and variables in the event graph every time I tweak my C++ code. Help!

Well, with a little help from some friends at Discord, I got it resolved. For those who may run into this problem in the future: Apparently changing a header file and then hot reloading is a no-no. Whoops. So, apparently the answer is to use Live Coding generally with 4.22, and when you edit a header file, exit out of the UE4 editor, and use the Local Debugging tool (the green arrow at the top) to re-compile and re-open the editor. It’s a bit of a clumsy process, but it seems to work just great.