- Home /
Every so often, every script in my scene has its values reset to default
Every once in a while, every script in my scene gets all of its inspector values reset to their defaults. This has happened to me about 5 times now over a month and a half period.
I've searched online but have not seen anything quite like this.
I have my entire Unity project folder in my Dropbox folder - could this cause problems?
In my scripts when I declare my variables I usually give them default values. If I set them in the inspector, however, this should override those (and stay that way) correct?
Any help or guidance would be appreciated.
Yes it should stay the way that you set them in the inspector, because they're serialized to the prefab/scene. Dropbox may have something to do with it, and you might want to try enabling meta files via "Edit/Editor > VersionControl > $$anonymous$$eta Files".
$$anonymous$$ine did this once when I imported some new textures and set them up into an atlas using NGUI. I haven't had any more occurrences of it though... maybe some sort of import bug?
Did you change the variables in the inspector while in "play mode"?
Answer by DannyB · Jun 08, 2013 at 11:02 AM
As mentioned in the comments, I believe that Dropbox is most likely the cause especially if there is a chance that this Dropbox folder may get updated from the outside (by another device accessing Dropbox, or another user, if this is a shared folder).
If you are placing it in Dropbox so you can easily share it between computers or people, then you need to take several things into account.
All in all, I would recommend NOT placing the project in Dropbox, but you can still use Dropbox for sharing.
For more information on version control (and naturally, sharing) in Unity, see this answer
For using Dropbox as a code repository, see this page
To just try and solve your problem, move your project to another folder and see if it still happens.