Sound not playing in build (unity cloud)


#1

Hello ,

I am using Fmod with Unity 5. The integration has been working really well, we have been testing and using it for several months. We are now trying to use Unity cloud, where before we would run the game mostly locally in the editor and building in each of our computers. In unity cloud however, we get some errors, from missing banks.

We have tried several options already in Unity clould build, and also did a development build to try and figure out what the error might be…we do have some clues, it seems that the banks are not being properly setup to the ones in the project. We already have the setting to use “Single platform buiild”…

attaching some screenshots, maybe it triggers a hint :wink: Thank you for the support and the tool, we love it :clap: :clap: :clap:


#2

There are a couple steps listed at the bottom of https://fmod.com/resources/documentation-api?page=content/generated/engine_new_unity/platforms.html#/

Building from Unity

Whenever Unity is started or the platform is changed, the Integration will copy the Banks for the current platform into the Streaming Assets folder.

If you are building from script BuildPipeline.BuildPlayer() won’t trigger a Bank copy if the target platform is different from the active platform. Use EditorUserBuildSettings.SwitchActiveBuildTarget() to switch to the target platform first.


#3

Hello,

" If you are building from script BuildPipeline.BuildPlayer() won’t trigger a Bank copy if the target platform is different from the active platform. Use EditorUserBuildSettings.SwitchActiveBuildTarget() to switch to the target platform first." where exactly should this be changed? It doesn’t mention in the docs where this is being set unfortunately


#4

Similar to when building using BatchMode from command line, you can create scripts to be called before the build is triggered. https://docs.unity3d.com/Manual/UnityCloudBuildPreAndPostExportMethods.html

Although this does depend on where the bank files are stored, because it will try to copy them over to the streaming assets folder.

A couple of things to note:

  • I would not recommend storing the built banks or the Studio project inside the Assets folder. This will bloat the size of your game as they will be included in the build. Even just having it sit along side the Assets folder is a better option.
  • If you want to skip the copying banks process, you can build the banks directly into the streaming assets folder (make sure it’s not inside a subfolder, eg. Desktop)