I’ve been getting a cryptic error that google is not helping me solve. When I hit play, this error sometimes occurs and sometimes doesn’t. It still happens seemingly at random. I’ve tried pausing my cloud storage (Dropbox) and that doesn’t seem to change the problem.
You are playing with fire. Directory sync services are NOT supported by Unity. You stand in peril of losing 100% of your work at any instant. You have been warned.
Please consider using proper industrial-grade enterprise-qualified source control in order to guard and protect your hard-earned work.
Personally I use git (completely outside of Unity) because it is free and there are tons of tutorials out there to help you set it up as well as free places to host your repo (BitBucket, Github, Gitlab, etc.).
You can also push git repositories to other drives: thumb drives, USB drives, network drives, etc., effectively putting a complete copy of the repository there.
As far as configuring Unity to play nice with git, keep this in mind:
https://discussions.unity.com/t/736093/3
Here’s how I use git in one of my games, Jetpack Kurt:
https://discussions.unity.com/t/807568/3
Using fine-grained source control as you work to refine your engineering:
https://discussions.unity.com/t/826718/2
Share/Sharing source code between projects:
https://discussions.unity.com/t/719810/2
Setting up an appropriate .gitignore file for Unity3D:
https://discussions.unity.com/t/834885/5
Generally setting Unity up (includes above .gitignore concepts):
https://thoughtbot.com/blog/how-to-git-with-unity
It is only simple economics that you must expend as much effort into backing it up as you feel the work is worth in the first place. Digital storage is so unbelievably cheap today that you can buy gigabytes of flash drive storage for about the price of a cup of coffee. It’s simply ridiculous not to back up.
“Use source control or you will be really sad sooner or later.” - StarManta on the Unity3D forum boards
Thank you for your detailed help on how to protect my code! I’m not concerned of the possibility of losing 100% because I have it stored locally (including full copied backups) and on dropbox, but I have run across times when prefabs got broken. Regardless, I will look into that soon and get my work much better protected.
Anyway, any idea on why I’m getting those cryptic error messages?
Nope.
Keep in mind simply turning off Dropbox does not undo possible previous damage done to your asset database.
I would try a reimport all perhaps.
Well, the reimport didn’t seem to fix it! Thank you for trying. Anybody else know why this might be happening?
So I held onto the e-mail to come back and look at this, and frankly, I’m VERY confused after reading through a couple of these links. I dug up very basic source control information, and some people said it doesn’t back up everything. I also determined that source control’s main function is when working with a team of people all working on the source code and helps with versions and what not. I can see how this could get messy and need some sort of team management feature, but long story short, I’m left wondering whether source control helps a one person amateur and what to do for backup if dropbox is the wrong result. Any ideas? Thank you!
It does. It’s just a “savegame cart” for programming. That’s all it is.
Watch this:
Ok, I’m getting the idea of what it does and can see a few advantages, so coupling that video with what you posted above, I have a few questions.
- How do you know which files to put in the git for unity?
- Where and how is a git stored on your computer?
- Do gits get extremely large?
- Is there some sort of GUI for git? I’m not much of a fan of terminal, though I recognize that video was using Linux. I’m on Windows, so I’m guessing this would be command prompt.
- How were you able to view file changes like you screenshotted in your 2nd link in your post above?
- It seems like this needs to be integrated into something. Like say there’s people changing .cs files in a visual studio project, then they need to be compiled. Does one just sync up to, say github, download the current versions of file changes, and then open the visual studio project and compile it?
- In the case of unity, you have to close, update the git, and reopen. You say you do that very often, but it takes a pretty good bit of time to load a unity project. Does this not slow you down considerably to have to close and reopen for every new git version?
- Overall, I’m seeing this as a means of creating backups each time that is smart enough to probably keep the file size down by tracking changes rather than making lots of copies. In addition, it can track version history more nicely. However, those seem to be the fundamental differences between this and standard copying a directory. It is clearly better if it works the way I think it does, but have I missed something fundamental about these?
The .gitignore file handles this.
There is no ‘a git’. You use git to manage repositories, or ‘repos’ for short. They are stored wherever you make them, which is usually the same folder as your Unity project.
There’s tons. GitHub is a straight forward one.
It doesn’t have to be integrated into Unity. It be done completely separately (such as Github).
You 100% don’t have to close Unity to make commits.
It’s version control on steroids that gives you 100% granular control over your changes, such as rewinding changes down to the individual line of code.
It’s industry standard to use version control software when making applications. There is zero argument to not using it.
Just use Github.
Agreed. But you must save scene and Save Project, otherwise Unity-managed assets won’t necessarily be ready to be committed.
Ok, thank you for all of the information! Let me follow up with questions matching mine above:
- So the .gitignore helps determine what to not save. How do you determine what you do save? I know certain folders are not really needed for backup, as unity will create them, such as the library folder.
2-3. Fair, so git manages repositories. How is a repository stored on your computer? Is it just one massive file with a particular extension?
-
It appears that github helps you manage the looking at files, but all I’ve seen so far for doing the commands is with command prompt or terminal. Is there a GUI to determine which files are committed, do a quick commit, etc.?
-
How were you (Kurt-Dekker) able to view file changes like you screenshotted in your 2nd link in your post above?
-
What process would you use to get access to the newest files and use them if somebody else had recently modified them?
-
I suppose that means there are a number of locked files to avoid so this works without closing unity. I’ll probably figure that out reading through the .gitignore stuff.
-
I can definitely see the advantages of revision history. My current tactic is to comment out a copy of the code if I drastically change it. The only argument I would have of not using it is it seems like a very steep learning curve to climb! But I’m trying. My method of learning is doing some reading and/or video watching and then asking questions to clarify.
We can blab on all day but just stop asking questions and start using it.
My 2-cents… YMMV
None of these answers address the toolbar error - still wish I knew why Unity throws that one.
GIT doesn’t understand Unity, and Unity can’t really tolerate GIT.
As with any version control, it must be configured properly - in this case a good .gitignore.
Also, NEVER use your file system or GIT for any copy, move, or rename operations.
Only use Unity (Project view, Hierarchy view, or Inspector) for any copy, move, or rename operations.
The reason is because Unity hashes every file and location in the metafiles, if you do a file operation outside of Unity you are corrupting your project meta files.
Every Unity file operation will break your GIT history - live with it.
There is no safe way to branch & merge in GIT without the potential of ruining you Unity project - don’t use branch & merge. One project (MAIN) and don’t do any file operations outside of Unity.
I’ve been using Unity for 13-years, I’ve designed and developed video games for over 4-decades.
I’ve used GIT a lot with Unity - I don’t like it.
I personally recommend SVN - it has all the same problems, but isn’t nearly as complicated.
I believe that PlasticSCM is the only VCS that works well with Unity… but I haven’t tried it yet, maybe next project.
I dunno about that man… sounds like you’re using it wrong. We use git at scale with about 100 engineers and artists all working in Unity committing to git, many different projects, extensive source code sharing with version-controlled submodules, and a CI/CD system that hoovers it all down and builds it on demand.
And we use git flow and sometimes have very long-lived feature branches, although when we do we plan for it and create new work areas to accommodate temporally-distant work.
Works like a charm every day.
Not true at all. That’s on your git client for one, but if you want give it the best shot at history tracking with --follow
, then commit ALL your work, move all your files in Unity, which will move the metas, then commit them at their new location. The fact that they were only moved will be picked up quite well.
You just blew your credibility out of the water with that statement. A lot of people “believe” a lot of really strange things in this world, and none of that belief is called “engineering.”
Good luck man.