Hi, having an issue with packed scenes resetting to default values when a level is reloaded - for example the player enters a building, the scene changes, then the player goes back outside - but a bunch of things arent working anymore. Closer inspection reveals that the @export variables are reset to default values for the child scenes, i.e. NPC name. Could this be the sign of a memory leak? Any ideas?
Objects are losing their persistence and defaulting to the PackedScene file configuration. I found that this happens when the code hops to a different scope.
There were actually two problems … one with the flags however the object persistence was apparently not the same issue. I thought maybe the memory was mis-aligned and overflowing on reload.
Finally realized …
The packed scene export variables referenced nodes that were children of the packed scene in the level - they dont get instantiated until after the parent node. I moved them up above to be sibling nodes instead.