Sacred Seed Studio Logo

Setting up a Unity dev environment on Windows

Sep 25, 2016 • Joel Kuntz

Read in 6m

Table of Contents


Whether you are just starting with Unity, reinstalling your operating system, or helping a friend; we all have to setup development environments. I frequently do this and there are several essential things needed for a well rounded environment. I hope to share my insights so that you can create your own environment and start making games in Unity right now.

Programs to install:

Step 1: Install Unity and IDE/Text Editor

The installer for Unity now has Visual Studio (Community version), where it used to include MonoDevelop. VS is a heavy IDE to start up, but it is very powerful for C#, which is the language we recommend using over Javascript (Unityscript). If you don’t want something as heavy as VS, you can also download Sublime Text 3, Atom, or VS Code and use those instead. To change the IDE/text editor connected to Unity, inside a project, go to Edit > Preferences... > External Tools and browse to find your editor of choice.

Unity Editor Git Settings

Step 2: Install Git

Windows 10 recently added the Windows Subsystem for Linux which allows you to run Ubuntu Bash. This is my favorite way to use git on windows. You can install WSL and run sudo apt install git, or alternatively get native applications of git, including some GUI applications like Sourcetree or GitHub Desktop.

If you aren't familiar with version control, you should be. It allows you to backup your project, tag points in time that can be referenced later, and easily work with a team or on an open source project. I can't overstate this! Please trust me when I say it will save you from frustration in the future. Learn git and go backup your projects now. Both github and bitbucket offer good free options.

If you're a student, go get the GitHub Student Developer Pack.

Step 3: Creating a Project and Changing Project Settings

Open Unity and log in to your account to be able to create a new project. You can choose where to save your project and whether or not it should be 2D or 3D. If you create a project and it’s not the dimension you want, you can change between 2D and 3D by going to Edit > Project Settings > Editor. Some versions of Unity contain a bug that creates a project and it doesn’t use the dimension you asked for, if that happens, just change your settings and then create a new scene to see the correct camera style.

Each time you create a new Unity project, you’ll need to change some settings to work with version control. I’m assuming this methodology will work for more than just git, but that’s what we will be using. Inside your unity project, go to Edit > Project Settings > Editor and change Version Control to Visible Meta Files. You will also need to change Asset Serialization to Force Text. Most version controls work in deltas or diffs, and it’s a lot easier for them to work in text than binary.

Unity Editor Git Settings

Step 4: Creating a Repository

i: Setup

You will now need to setup your repository, repo for short. You can make a repository in two ways, whether or not you have or haven’t started your project yet.

The first way is through bash (or your command line):

mkdir my-new-project
cd my-new-project
git init

The second way is through an online interface: github(shown) Unity Editor Git Settings There are some important settings when creating a repo on Github:

ii: GitIgnore

.gitignore Is a special file that tells git what we don’t want committed to the repository. This is used for binaries, assets, and Unity Editor/IDE created files that only slow things down and cause headaches for us and others accessing our project. github hosts the unity one like is selected above.

If you went the command line route, there will be a hidden file named .gitignore in the root of your repository. You can open it and view it in a text editor. It should be the very first thing you commit. The .gitignore below will assume you have your Unity Project at the root of your repository.

If you want your Unity Project to be nested or to have multiple projects in this repo then simply remove the leading /

/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/Assets/AssetStoreTools*
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
# Unity3D generated meta files
*.pidb.meta
# Unity3D Generated File On Crash Reports
sysinfo.txt
# Builds
*.apk
*.unitypackage

iii: Committing and Pushing

Move your Unity project into your repository folder. You’ll need to close Unity before doing this. Now that we have our gitignore it will be safe to move it all over as we only will add Assets/ and Project Settings/ to commit as the rest is autogenerated by Unity and our IDE. Unity project structure usually looks like this:

Sometimes when you’re moving a project, a Unity Lock file won’t want to move and will cause trouble, skipping that file is ok.

my-new-project/
├── Assets
├── Library
├── ProjectSettings

The following commands will add the files in your new project to be committed, review the commit, make the commit, then push to your remote (Github etc). If this is confusing, again, Learn git.

git add Assets/ ProjectSettings/
git status #Review what we have staged before committing
git commit -m 'Initial unity project commit.'
git push origin master # If you are setup to a remote like github/bitbucket

Step 5: Find, Create and Edit Assets

Now that you have a project and a repo, you’ll need some assets for your game, and ways of dealing with them.

Finding Assets:

Creating and Editing Assets:

Cool People and Repositories:

You are now ready to begin (or continue) your game development journey. A few bits of closing advice:

Good luck explorers!

Share this!

Twitter Facebook
Last updated: Jun 11, 2017