When I re-compile project code, blueprint variables with types I have defined in code disappear from their respective blueprints

I have a custom struct type that I have defined in a c++ source file hooked up to my Unreal project. Occasionally when I re-compile my code through the Unreal Editor, all variables in my blueprints with that struct as their type will disappear form the blueprints they used to be in. If I try to re-create the variables, it says that their names are still in use by the disappeared variables regardless of them being gone now.

54045-capture.png

As you can see from this picture, the name is actually not in use anywhere. I can sometimes fix this by closing and re-opening the editor, but I just tried it for this occurrence of the issue (probably the tenth time) and it didn’t fix it this time.

Also every time I try to compile an effected blueprint, I get an error saying “Error The variable AxonDevice declared in DCU_Game_Mode has an invalid type Structure”. This is while I cannot see the variable, and that is the name of the variable that disappeared.

This seems to occur mostly when I make changes to my code that include one of the following:

  • Creating a new function that uses that variable type as a parameter
  • Editing an existing function’s signature that has a parameter of that type

Hi janimationd,

Thank you for pointing this out. Using your information, I was able to reproduce this issue, and I have submitted a report to have this investigated further (UE-20475). The only workaround I found was that in the specific instance where you have a Blueprint variable of a custom struct type and you are modifying a function in code that takes a parameter of that struct type, don’t perform a Hot Reload. It isn’t really an ideal workaround though, and I have not tested it extensively to make sure it works in any circumstance.

Yeah, I’ve resorted to simply closing the editor and then compiling the code through visual studio, does this avoid a hot reload?

How do you go about compiling through visual studio I broke a reference and it defaulted to structure. It would be nice if the variable just remained visible.