FMOD Tip - Gitignore for the FMOD Integration in Unity (FMOD Unity Gitignore)

Hi!
I just wanted to share the .gitignore that I’ve been using when implementing FMOD in Unity.

FMOD Gitignore Lines

Add these lines to your git-/hg-/collab-ignore file:

### FMOD Unity Integration ###
# Never ignore DLLs in the FMOD subfolder, so make sure that the FMOD-folder is in the correct path.
!/[Aa]ssets/Plugins/FMOD/**/*.dll

# Don't ignore images and gizmos used by FMOD in the Unity Editor
!/[Aa}ssets/Gizmos/FMOD/*
!/[Aa}ssets/Editor Default Resources/FMOD/*

# Ignore the Cache-file since it is updated locally either way
/[Aa]ssets/**/FMODStudioCache.asset
/[Aa]ssets/**/FMODStudioCache.asset.meta
/[Aa]ssets/Plugins/FMOD/Cache.meta
/[Aa]ssets/Plugins/FMOD/Cache/Editor.meta

# Log-files
fmod.log
fmod_editor.log

# FMOD 1.10.x (Legacy)
/Assets/FMODAssets/*
/Assets/FMODStudioCache.meta

Here’s an explanation as to why I’m explicitly telling Git to NOT ignore any .dll-files in the Assets/Plugins/FMOD/-folders:

Full Fmod Unity Gitignore

Here’s a full gitignore which you can put at the root of your Unity-project (ie. one folder up from /Assets/) when creating a new Unity project which will use FMOD:
.gitignore with fmod.txt (1.1 KB)

Just rename the file to .gitignore. (with the dot at the end!) and it will “become” a proper gitignore-file.

Or you can copy-paste the text from here:

[Ll]ibrary/
[Tt]emp/
[Tt]emp.meta
[Oo]bj/
[Bb]uild/
[Bb]uilds/
Assets/AssetStoreTools*

# Visual Studio cache directory
.vs/

# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.opendb

# Unity3D generated meta files
*.pidb.meta
*.pdb.meta

# Unity3D Generated File On Crash Reports
sysinfo.txt

# Builds
*.apk
*.unitypackage

# Mac stuff
.DS_Store
.bak
.BAK

### FMOD Unity Integration ###
# Never ignore DLLs in the FMOD subfolder, so make sure that the FMOD-folder is in the correct path.
!/[Aa]ssets/Plugins/FMOD/**/*.dll

# Don't ignore images and gizmos used by FMOD in the Unity Editor
!/[Aa}ssets/Gizmos/FMOD/*
!/[Aa}ssets/Editor Default Resources/FMOD/*

# Ignore the Cache-file since it is updated locally either way
/[Aa]ssets/**/FMODStudioCache.asset
/[Aa]ssets/**/FMODStudioCache.asset.meta
/[Aa]ssets/Plugins/FMOD/Cache.meta
/[Aa]ssets/Plugins/FMOD/Cache/Editor.meta

# Log-files
fmod.log
fmod_editor.log

# FMOD 1.10.x (Legacy)
/Assets/FMODAssets/*
/Assets/FMODStudioCache.meta

Gitignore location:
image

2 Likes

Thanks for sharing, we’ll add some of this to our documentation to help others.

2 Likes

Awesome! Looking forward to seeing it in the official docs :slight_smile:

/Pablo

Awesome! There’s the ultimate .gitignore that I use now, over at https://github.com/github/gitignore/blob/master/Unity.gitignore
this will be a great addition to it

1 Like

Many thanks Paalo!

1 Like

Happy to help @jorickbronius :slight_smile:

thanks Paalo

1 Like

I’m new to FMOD unity integration and git. Glad I found this info.

Sorry if it’s obvious, but does it mean the following steps will ensure every member has a working, FMOD integrated project?

  1. I clone the team’s repo
  2. Update and push .gitignore
  3. I import the FMOD unity integration package locally
  4. Set project & build path
  5. Push for everyone

Or do they have to manually import the integration package at some point?

1 Like

@chocobo that’s correct, if you follow those steps then your teammates will get the FMOD Unity Integration when you push it to them (Step 5 on your list) :slight_smile:

Happy to help!

1 Like

So upon further investigation, I believe the best way is a hybrid between pushing everything on git and doing manual integration by each member.

The problem with the push-pull-only approach is that each team has its own .gitignore setup, which would likely cause some part of the FMOD integration to not be tracked besides the .dll, which we tried did break the integration. Even using the community-maintained .gitignore here while including the .dll caused the breakage.

Another problem is with /Assets/Plugins/FMOD/lib, where the bulk of the integration resides (close to 400MB) but won’t change during the course of development, only slowing down git.

What I did was to add a line to ignore /Assets/Plugins/FMOD/lib, and then let teammates install the integration themselves, and it worked on everyone’s systems.

A caveat of this approach though, is if you ever want to delete the integration, you’ll have to go through extra steps on each person’s system, or completely remove the repo and clone again from earlier state without the integration.

TL;DR start to finish steps

On your end:

  1. Clone the team’s repo
  2. Update .gitignore with the lines suggested by @Paalo and;
  3. Add /[Aa]ssets/Plugins/FMOD/*

In FMOD, the goal is to establish sound bank build path & separate it and the FMOD project to make it easier for git

  1. Open FMOD
  2. Create a new project with at least some sound in it, or use the example project for testing purposes
  3. Edit > Preference > Build > Built banks output directory
  4. Under the same tab > Project platforms > Desktop > set to Stereo
    (Down the road, make sure everyone has their Unity > Edit > Project Settings > Default Speaker Mode set to the same thing)
  5. Navigate to repo root, create new folder (e.g. AssetsFMOD) and select
  6. File > Build
  7. Open Unity and load the team’s project
  8. Load a scene
  9. Download and import the FMOD unity integration package (At some point you have to let every team member have this package themselves)
  10. Follow official doc in setting up everything and putting sound in the scene
    https://www.fmod.com/resources/documentation-unity?version=2.1&page=user-guide.html
  11. Save, commit and push
    (If you’re using example project, the sound bank will require the use of git lfs. We added *.bank to .gitattribute to track all sound bank changes on our lfs service)

What you pushed will not be working on other machines due to .gitignore and that’s where manual integration comes into play

On teammates’ end:

  1. Pull
  2. Open Unity project
    (At this point since it’s broken, all the sound emitters will fall back to null/ produce error messages)
  3. import FMOD integration package
  4. Set bank path as you did with the help of same official doc
  5. git reset --hard
  6. Return to project and they should have it working. Some teammates of mine had to set the bank path again to make it work.
1 Like

Usually we’d expect people to commit their .gitignore to git so everyone is setup correctly. There is a section in our user guide that gives an example addition to add to your shared gitignore correctly permitting the FMOD libs (and other files) even if they are excluded more globally. This addition is compatible with the Unity master .gitignore.

This is the recommended workflow so that the rest of the team doesn’t need to deal with FMOD integration. It also means when FMOD is updated, the change is rolled out to all instead of asking everyone to make changes (potentially leaving some people on the wrong version).

1 Like

Do you have to put the path before the exclamation mark too?

Never ignore DLLs in the FMOD subfolder, so make sure that the FMOD-folder is in the correct path.

C:/XssR/IAM6/!/[Aa]ssets/Plugins/FMOD/**/*.dll

No, the paths are relative to the .gitignore file, so for you, place the file in C:/XssR/IAM6

1 Like

Thank u!

Hey, I am just starting to use FMOD and I am running into a small issue.

So I have Unity opened with FMOD for Unity package imported.

I have set up the gitignore according to your advice.

Then when I switch a branch, one of the dll files is not removed and is being transferred to the branch that I have switched to. Specifically, its the Assets/Plugins/FMOD/platforms/win/lib/x86_64/fmodstudioL.dll

Obviously, if I first close Unity and then switch the branch this does not happen.

Of course, I could do this every time I need to switch a branch, but it is kind of annoying. Does anyone know of any fix for this?

Thanks in advance.

Just linking in the response from your other post here:

If there is the following line in the git: /Assets/FMODAssets/*, doesn’t that mean my sound colleague and I won’t be able to share assets? If so, what is the best way to handle this situation?

Hi,

What version of FMOD and FMOD Unity integration are you using?

Could I get a screenshot of the project directory in Unity, showing the FMOD Integration and the assets you wish to share with your colleagues?

The referenced gitignore is no longer up to date. Please refer to our documentation here for the current verison and recommended workflow: https://fmod.com/docs/2.03/unity/user-guide.html#using-source-control

Hope it helps, please don’t hesitate to ask if you have any questions.