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.

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.