Hey folks, I’ve made a separate post about the seeming volatility of scene variables, that the strings can get overwritten, etc., but this problem seems much worse.
I can not figure out why but I made a list of Object level variables in a prefab (our games logic object) and the moment I hit play half of them disappeared. In the image you can see OBJ_Dgs2 used to exist, but I don’t have reference to it anymore.
Why is this happening? To reiterate, I’ve saved prefab changes, the moment i hit play most of my things are gone. It seems like Scene variables disappear when you don’t save the scene, that makes sense – why would these object variables no longer be in the list?
Prefabs from Project window can’t hold scene references directly. So if you’re editing a prefab in prefab mode and assign it scene references not part of the same object or its children, they will be lost.
So in this instance, these children are part of the same game object (children of the prefab, the prefab parent / root is holding the ScriptGraph). The changes to prefab and overrides are all saved and still we lost things. Have you experienced this at all? I can’t find any documentation on whether or not we’re setting this up wrong.
I have experienced what I described back when I was learning the tool. Any other loss of serialized data in variables is likely a bug. If you can reproduce this in a new Unity project, report that to Unity by clicking on Help->Report a bug.
There is no special setup for retaining data in variables, it should just work. Personally, I wouldn’t use Visual Scripting package in its current state, it has been in maintenance mode for nearly 5 years with next to no user facing development. Consider switching to Flow Canvas/Node Canvas combo, which is decently well supported and proven in production and functions by the same principles as Visual Scripting package.