How to collaborate on a Unity project

Unity has retired Unity Collaborate. Learn how to use Git-based version control to collaborate on a project with your team or simply improve your development workflow.

Matthäus Niedoba
March 4, 2024
7
min read
Content

If you are looking for Unity Collaborate, a version control system from Unity that was introduced in 2016 and will be deprecated in 2021, this article will show you how to use Git as an alternative solution. If you are new to version control, read on. If you are already familiar with it, you can take a look at how to use Unity with GitHub.

How does Unity handle teamwork?

Version control

You need to use version control. It comes from software development and game development has a very similar workflow. Unlike with Blender files, you cannot save Unity files incrementally (v001, v002. v003). The engine won’t understand that these are version of one single asset. A version control system does that for you but in a more intelligent way. Version control allows you:

  • To do backups for your project, in case your files get corrupted
  • To sync between computers
  • To share your files with your team
  • It forces you to work in a proper way by committing your work at least once a day
  • Adds documentation to your work
  • It facilitates team collaboration with features such as file locking, so that you prevent losing work due to the fact that two people have worked on the same file at the same time

Why can’t I use just Dropbox or a NAS?

The reason is simple: these services sync changes instantly, and game engines like Unity don't manage files in a way that supports incremental saving for complex projects. A Unity project, much like an Unreal project, is made up of many interconnected files. For example, importing an FBX file into Unity converts it into a proprietary .asset or .prefab file, depending on the content type. Re-importing an updated FBX file simply updates the existing .asset or .prefab file without creating a versioned duplicate (like _v002.prefab). This is different from software like Blender, which allows more direct control over file versions.

Now consider the scenario of collaborating on a Unity project using Dropbox. Multiple team members could end up overwriting each other's work, with no easy way to revert to previous versions if necessary. Think of the hours of work that could be lost. A version control system prevents this by forcing you to use a proper workflow and adding the safeguards mentioned above.

However, there is a place for syncing services like Dropbox, Google Drive, or a NAS, and that is for things like your asset library, game builds, 3D scans, image sequences, and basically anything that is not a document file that needs to be versioned.

Anchorpoint, Git based version control on a unity project
What a version history and tracked file changes look like in a version control application (this one is Anchorpoint)

How to use Git version control with Unity

What is Git and what is GitHub?

Git is a version control system. GitHub is a cloud service provider built on top of Git. There are other version control systems like Perforce, Plastic SCM (as of 2021 it's called Unity Version Control) or Subversion.

Regarding GitHub, there are also other cloud service providers that are part of the Git ecosystem, in other words, they are compatible with the Git version control system, such as GitLab or Azure DevOps.

the version control ecosystem
Where Git and GitHub fit into the whole ecosystem

What software do I need?

You need two things. A cloud service provider to share your files, and a desktop application to push and pull those files. Since GitHub is the most popular, you can start with it. If your project has large storage requirements (for example, it needs many GBs), then you can choose Azure DevOps. If you are dealing with customer data and security is a big option, then you can pick GitLab because you can self-host on your own system.

For a desktop application, you can pick Anchorpoint, the application we're developing, because (we're trying to be honest here) it was designed for game development, especially for non-technical people. If you are an experienced developer and you need Git features like rebasing, stashing, blaming, etc. then you should go for something like SourceTree or GitKraken.

The basic workflow

Most of the time you will be pushing and pulling files to and from GitHub using Anchorpoint or another desktop application. It's similar to what a Dropbox desktop application would do, but instead of automatically syncing, you're doing these steps manually.

version control basic workflow with GitHub
The basic workflow using version control

Artist A (You):

  • You work in Unity.
  • You import new assets, modify materials, and edit scenes. Your actions result in a set of modified files (typically a list of .fbx, .prefab, and .unity files).
  • Anchorpoint detects all file changes and creates a list of files for you, ready to be pushed.
  • You commit and push these changes to GitHub. It's common practice to comment on your changes, e.g., "Adjusted lighting to create a warmer atmosphere."
  • Your changes are then uploaded to GitHub

Artist B (Your friend):

  • Works in Unity, focusing on a different part of the project, such as a different scene or asset.
  • He maintains a local copy of the project, allowing him to work uninterrupted by your changes.
  • Anchorpoint alerts him of new changes available on GitHub
  • Your friend pulls your changes, updating his local project to the latest version.
  • He then makes his own changes, commits, and pushes them to GitHub with a descriptive comment.
  • Both of you maintain a synced project with a detailed commit history, providing insights into the project's evolution.

How to structure your project files

A Git repository is not the file sync solution for everything. For some special cases, you will need a shared folder on a Dropbox, Google Drive, or NAS. This is how you decide what to put where.

git repository vs shared folder
Which files to put in the Git repository and which to put in a shared folder

Git repository

The term "repository" means the same as project. A project folder on your computer is synchronized with your Git repository on GitHub.

In addition to your Unity project, it may also make sense to add your art files, which include Blender, Substance and ZBrush files, to your Git repository. The reason is simple. You have them all in one place, and you use the same version control workflow for all assets that require iterative work.

If you're working with outsourcing companies that only produce, say, art content, then it makes sense to have two separate Git repositories (one for Unity and another for art files) because you can only give external vendors access to one repository, so they never see, say, your game source code.

Shared Dropbox, Google Drive or folder on a NAS

Content that does not need to be versioned should go to a simple file synchronization solution. That's because these services are easier to use. This is also where you share files with external stakeholders (customers, marketing team, QA, etc.). Files of this type usually belong there:

  • 3D Scans
  • Footage (3D, audio, video, images) from cameras or Internet libraries
  • Rendered image sequences
  • Files coming from a client (e.g. CAD models)
  • Files going to the client (such as a build or videos)
  • Your asset library
  • Game builds for your QA department

How to use GitHub and Unity?

This tutorial will show you how to set up a repository on GitHub and how to use Anchorpoint to invite team members to your project and collaborate. Keep in mind that GitHub is just one of many hosting solutions, and Anchorpoint is just one of many Git desktop applications. After watching this video, you should be able to start your first Unity project with proper version control.

Version control for artists

Anchorpoint is the simplest version control solution for non coders that work on Unity projects.
Learn about Anchorpoint

Frequently asked questions

What are good alternative to Git?

  • Unity DevOps (Formerly Plastic SCM): Offers good binary file handling, integrated Unity support, fast client response, and both centralized and decentralized workflows.
  • Perforce: Known for its use in AAA game development, offers scalable solutions, excellent single file operation handling, and robust security options.
  • SVN (Subversion): A centralized version control system that is simpler and has been around longer than Git. It's known for its straightforward linear approach to version control, making it easier for some to understand and manage.

Each of these alternatives has its pros and cons, tailored to different project needs and team sizes.

Is Git open source?

Yes, Git is an open-source system, which contributes to its large community of cloud services, desktop applications, and integrations. Numerous paid services build upon Git, offering customer support for those who prefer not to manage it on their own.

What is a .gitignore and why do you need it

The .gitignore file is an essential tool when using Git for Unity project management. It prevents the upload of superfluous files to your repository. Positioned typically at the root of your project, this plain text file establishes guidelines for Git on which files should be disregarded. It's especially useful for excluding files in directories like Library, Temp, or Logs, which are locally generated during development and can unnecessarily bloat your repository.

How does branching work?

As projects grow in complexity or the team expands, managing concurrent development efforts becomes more challenging. This situation can lead to interruptions in workflow, especially when ongoing work from developers impacts the artists' contributions. To navigate these challenges, the project can be divided into distinct sections or "zones," allowing individuals or small teams to work independently without stepping on each other's toes. Once the tasks in these zones are completed, they can be reintegrated into the main project. This approach is facilitated by using "Branches" in Git, which effectively allows for parallel development streams.

What is Git LFS?

Git LFS is an extension to Git that allows you to work with binary files. Unity scenes are text-based files, but 3D models, audio, and images are binary files. Anchorpoint automatically handles Git LFS. If you are using other Git clients, you will need to ensure that Git LFS is enabled. All Git hosting providers support Git LFS out of the box.