Issues with Unity Version Control

This is the first time I’ve tried using Unity Version Control in a small group of people and have found it very confusing as Unity seems to be overwriting info and breaking our prefabs and scriptable object data. (My theory is this happened because another person in the project relocated the scriptable objects and prefabs to a new fold and that is what confused Unity) My coworker is able to pull just fine without issue,

When I change the workspace to the latest branch it seems to pull fine,

All the data in the scriptable object data is there.

The Particle Prefab that pulls from this data is working just fine as well.

(When I switch to the new branch the new input system seems to break somewhat my WASD input still works but anything else such as my left click right click buttons do not work)

Now the issue lies when I restart Unity… The Scriptable objects lose all their data

and the particle prefab breaks

All the controls are functioning again however and I can use WASD and the mouse left click right click…

I’ve tried to
fully delete the project redownload it
Fully delete and redownload to a different location
Fully delete do a full shutdown to make sure unity doesn’t do background things and the download to a new folder.

Having the other person put the affected files in a zip sending it to me and then deleting the files locally and putting their files in, which had no change…
Reinstall unity

I’m at my wits end and not sure how to fix this issue, clearly it’s correctly pulling data in the beginning (however breaking some of my own Unity until i restart) but in unity doing what ever behind the scenes on restart is breaking things.

The file for the scriptable object is the same when broken in Unity as the info from the zip where they work fine. So Unity is clearly not losing the data it’s just not reading it properly after i restart Unity?

(BELOW is after the scriptable object is “broken” in the Unity scene)

(BELOW is the data I pull in from the zip of the data where they work perfectly fine on the other machine)


This is one of the particles file history, we did start doing “save project” before we push them after searching through google for help and someone stated unities “Save” doesn’t actually properly save to the disk. But when we first started our first few pushes we had not been using “save project” but only normal save.

2 is the original scriptable object which we had been using just “Save” and not “Save Project” and # 19 is after we started using “Save Project” it does have a little more data because it’s been developed a bit since initial commit.

You want one of these forums:

https://forum.unity.com/categories/unity-devops.898/

Highly recommend using git instead. Here’s my cribsheet:

PROPERLY CONFIGURING AND USING ENTERPRISE SOURCE CONTROL

I’m sorry you’ve had this issue. 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:

I usually make a separate repository for each game, but I have some repositories with a bunch of smaller test games.

Here is how I use git in one of my games, Jetpack Kurt:

Using fine-grained source control as you work to refine your engineering:

Share/Sharing source code between projects:

Setting up an appropriate .gitignore file for Unity3D:

Generally the ONLY folders you should ever source control are:

Assets/
ProjectSettings/
Packages/

NEVER source control Library/ or Temp/ or Logs/
NEVER source control anything from Visual Studio (.vs, .csproj, none of that noise)

Setting git up with Unity (includes above .gitignore concepts):

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.

If you plan on joining the software industry, you will be required and expected to know how to use source control.

Source control does require learning, but there are TONS of tutorials and courses and online reference.

You should strive to use source control as confidently as you use your file/folder system.

“Use source control or you will be really sad sooner or later.” - StarManta on the Unity3D forum boards

1 Like

Thank you Kurt for the info about git and using it,
We ended up migrating our project over to git and will hopefully not encounter any issues with that! hah