Hi, I just figured out why my exported variables kept disappearing. It was caused by this known bug.

Ok so I have a base class A with exported variables. This class is generic so I can't make a node out of it. Then I have an inherited class B that I want to use in the editor. If I put [Tool] on A, the exported variables work but B isn't recognized in editor. If I put [Tool] on B or both of them, it works in editor but the bug randomly erases exported variables. The variables return after scene reload but resources get emptied permanently.

Now is there a workaround that wouldn't force me to abandon generics or C#? I could try to split my classes and make all exported data separate but it would be a mess. Maybe restructure the code to touch the engine as little as possible, but the convenience of exported variables and resources is high.

To quote Scripptor:

Happens on 3.2.3.stable.mono It only seems to affect scenes that are currently opened, active or in the background! So if you want to save your work and you have a level with inherited tool scenes with script variables, please close the level scene before building! This might just save you some time! Perhaps see if that helps?

Thanks, that seems to help for nodes. I'm not sure for resources, it feels as though they reset every time a build fails but I'll have to test it.

a year later