Changing C++ method signature invalidates blueprint node with error

Hi,

I’m writing a C++ method, and exposing that method as a blueprint node. I created the node, and attempting to modify the C++ code and retest my changes. While I can change the implementation of the method within the .cpp method body just fine, if I try to change the methods signature (i.e. adding/changing function parameters, return value) and hot reload, the node in the blueprint becomes an “error”. The only solution seems to be to create a new node after hot reload and reconnect the blueprint wires, and delete the old “error” one.

As an example:

  1. I create a method called “CastRays” in my C++ code, defined with a dummy “boolean” value:

  1. I create a blueprint node using “CastRays” in a blueprint, connect inputs/outputs/exec pins

135277-bug_noerror.png

  1. Test/execute blueprint. Everything works fine.

  2. I remove the “dummy” parameter from the C++ method

  1. My previous blueprint node now is an “error”. I’ve tried “Refresh Nodes”, but it does nothing. It seems the hot realoder doesn’t understand how a function changes sometimes.

The only thing I can do to fix 5) is to re-add the node to the blueprint, reconnect the pins, etc. Which is time consuming, especially if I have many such nodes scattered throughout the project.

For example, I can re-add the blueprint node below, but UE4 never seems to pick up that the old function with the old signature should change. For example, the top one in the image is with the error, the bottom node is by manually re-adding the same node after the change:

I should note, that on step 4):

  1. I remove the “dummy” parameter from the C++ method

I also mean I build as well.

Probably related to hot reload system. found a relevant thread here: Completely disable hot reload system - C++ - Epic Developer Community Forums

Results of that thread seem to indicate to not use hot reload if changing headers/interfaces, only when changing implementation in Cpps. Which totally makes sense given the complexity of having to map symbols from DLLs after changing the function signatures. but it would be nice if the hot reload system at least tried detecting this type of stuff to give some helpful message to the user like “don’t do this, or if you do, rebuild your project and restart editor”.