After compiling and creating a blueprint I changed the return type from int32 to float and compiled inside the editor. I noticed that the return pin did not change from an integer to a float, however I did not crash. Which version of the engine are you working in where you crashed when hot reloading in the editor?
I kind of expected this and it’s probably a known issue / limitation of hot compiling.
Just to verify that I could reproduce the original crash, I tried it again and it crashes. Here’s my steps:
Take an existing class within my game and add the above code to it.
Within the level blueprint I make a call to the Test function and use the Print node to print the output to the screen on every tick function.
I run the blueprint and it prints 1.2 on the screen repeatedly. So far, so good.
I go back into the code and change the return value from a float to uint8, change the returned value to 15, then recompile. This causes a crash.
Note: I had the level blueprint open at the time. It may or may not matter.
Here is the blueprint I used. Note that there is a cast node right by the print string. Switching the function return value should break the link on recompile, but it crashes instead.
Sorry for the delayed response. Looking at your workflow, where you changed “float” to “uint8” appears to be the issue. uint8 is not a data type supported by blueprints. You should be able to use int32 instead for integer values. Note that the pin for the return value in blueprints won’t update from float to int until the editor is closed and reopened (UE-7646).