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
@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)
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:
Clone the team’s repo
Update .gitignore with the lines suggested by @Paalo and;
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
Open FMOD
Create a new project with at least some sound in it, or use the example project for testing purposes
Edit > Preference > Build > Built banks output directory
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)
Navigate to repo root, create new folder (e.g. AssetsFMOD) and select
File > Build
Open Unity and load the team’s project
Load a scene
Download and import the FMOD unity integration package (At some point you have to let every team member have this package themselves)
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:
Pull
Open Unity project
(At this point since it’s broken, all the sound emitters will fall back to null/ produce error messages)
import FMOD integration package
Set bank path as you did with the help of same official doc
git reset --hard
Return to project and they should have it working. Some teammates of mine had to set the bank path again to make it work.
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).
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?
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?