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

**URL:** <https://forums.unrealengine.com/t/when-i-re-compile-project-code-blueprint-variables-with-types-i-have-defined-in-code-disappear-from-their-respective-blueprints/328597>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [August 13, 2015, 8:54pm UTC](https://forums.unrealengine.com/t/when-i-re-compile-project-code-blueprint-variables-with-types-i-have-defined-in-code-disappear-from-their-respective-blueprints/328597 "2015-08-13T20:54:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![janimationd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@janimationd](https://forums.unrealengine.com/u/janimationd)\
**Post date:** [August 13, 2015, 8:54pm UTC](https://forums.unrealengine.com/t/when-i-re-compile-project-code-blueprint-variables-with-types-i-have-defined-in-code-disappear-from-their-respective-blueprints/328597/1 "2015-08-13T20:54:33Z")

</div>

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](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/a/4/fa464c9f2a5ea3c0406c8ef7ec908bf4fd5ac5d5.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.

---

<div class="post-metadata">

**Author:** ![janimationd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@janimationd](https://forums.unrealengine.com/u/janimationd)\
**Post date:** [August 13, 2015, 8:57pm UTC](https://forums.unrealengine.com/t/when-i-re-compile-project-code-blueprint-variables-with-types-i-have-defined-in-code-disappear-from-their-respective-blueprints/328597/2 "2015-08-13T20:57:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![janimationd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@janimationd](https://forums.unrealengine.com/u/janimationd)\
**Post date:** [August 20, 2015, 7:54pm UTC](https://forums.unrealengine.com/t/when-i-re-compile-project-code-blueprint-variables-with-types-i-have-defined-in-code-disappear-from-their-respective-blueprints/328597/3 "2015-08-20T19:54:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [August 27, 2015, 6:36pm UTC](https://forums.unrealengine.com/t/when-i-re-compile-project-code-blueprint-variables-with-types-i-have-defined-in-code-disappear-from-their-respective-blueprints/328597/4 "2015-08-27T18:36:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![janimationd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@janimationd](https://forums.unrealengine.com/u/janimationd)\
**Post date:** [August 27, 2015, 7:22pm UTC](https://forums.unrealengine.com/t/when-i-re-compile-project-code-blueprint-variables-with-types-i-have-defined-in-code-disappear-from-their-respective-blueprints/328597/5 "2015-08-27T19:22:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_39e0c4fa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_39e0c4fa](https://forums.unrealengine.com/u/anonymous_user_39e0c4fa)\
**Post date:** [May 18, 2017, 3:38am UTC](https://forums.unrealengine.com/t/when-i-re-compile-project-code-blueprint-variables-with-types-i-have-defined-in-code-disappear-from-their-respective-blueprints/328597/6 "2017-05-18T03:38:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![janimationd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@janimationd](https://forums.unrealengine.com/u/janimationd)\
**Post date:** [May 19, 2017, 8:12pm UTC](https://forums.unrealengine.com/t/when-i-re-compile-project-code-blueprint-variables-with-types-i-have-defined-in-code-disappear-from-their-respective-blueprints/328597/7 "2017-05-19T20:12:12Z")

</div>

> **[LMGTFY - Let Me Google That For You](https://lmgtfy.app/?q=unreal%2Bengine%2Bvisual%2Bstudio)**
>
> For all those people who find it more convenient to bother you with their question rather than to Google it for themselves.
