# Bus not found when using Unity batch mode or Cloud Build

**URL:** <https://qa.fmod.com/t/bus-not-found-when-using-unity-batch-mode-or-cloud-build/18713>\
**Category:** Unity\
**Tags:** unity\
**Created:** [May 1, 2022, 10:40pm UTC](https://qa.fmod.com/t/bus-not-found-when-using-unity-batch-mode-or-cloud-build/18713 "2022-05-01T22:40:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![goldfire](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/goldfire/32/1433_2.png) [@goldfire](https://qa.fmod.com/u/goldfire)\
**Post date:** [May 1, 2022, 10:40pm UTC](https://qa.fmod.com/t/bus-not-found-when-using-unity-batch-mode-or-cloud-build/18713/1 "2022-05-01T22:40:59Z")

</div>

Everything works as expected in the editor and it all works fine in a build from the editor as well. However, I get the following error when trying to call `RuntimeManager.GetBus(busPath);` when running a build generated in batch mode from the command line (which is also what Cloud Build uses).

```auto
BusNotFoundException: [FMOD] Bus not found 'bus:/SFX/Weather/Wind Howls'
  at FMODUnity.RuntimeManager.GetBus (System.String path) [0x00000] in <00000000000000000000000000000000>:0 
  at GoldFire.FMODPlayer.SetVolume (System.String name, System.Single value) [0x00000] in <00000000000000000000000000000000>:0 
  at WeatherController.SetWeather () [0x00000] in <00000000000000000000000000000000>:0 
  at WeatherController.Start () [0x00000] in <00000000000000000000000000000000>:0 

```

I’m using Unity 2021.2.18 with FMOD Unity Integration 2.02.03. I’ve confirmed that the Master.bank is in the build as are the StreamingAssets. The FMOD settings in Unity correctly point to the FMOD project, but I also tried doing “single platform” and pointing to the build location with the same result. The same issue happens with a Mac or Windows build.

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [May 4, 2022, 5:59am UTC](https://qa.fmod.com/t/bus-not-found-when-using-unity-batch-mode-or-cloud-build/18713/2 "2022-05-04T05:59:11Z")

</div>

I’ve not been able to replicate this issue. I’ve created a Unity project, can grab any bus, and can play without issues when built from the command line in batch mode.

Are you able to share your build script with us?

---

<div class="post-metadata">

**Author:** ![goldfire](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/goldfire/32/1433_2.png) [@goldfire](https://qa.fmod.com/u/goldfire)\
**Post date:** [May 4, 2022, 12:48pm UTC](https://qa.fmod.com/t/bus-not-found-when-using-unity-batch-mode-or-cloud-build/18713/3 "2022-05-04T12:48:28Z")

</div>

Sure, this is the script:

```auto
using System;
using UnityEditor;

class AutoBuild {
  /// <summary>
  /// Run the automated build.
  /// </summary>
  static void Run() {
    // Get the list of scenes in the build.
    EditorBuildSettingsScene[] enabledScenes = Array.FindAll(EditorBuildSettings.scenes , (s) => s.enabled);
    string[] scenes = new string[enabledScenes.Length];
    for (int i = 0; i < enabledScenes.Length; i += 1) {
      scenes[i] = enabledScenes[i].path;
    }

    // Run the build.
    BuildPipeline.BuildPlayer(scenes, "Build", BuildTarget.StandaloneOSX, BuildOptions.None);      
  }
}

```

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [May 5, 2022, 1:25am UTC](https://qa.fmod.com/t/bus-not-found-when-using-unity-batch-mode-or-cloud-build/18713/4 "2022-05-05T01:25:20Z")

</div>

I’m still able to build a game using this script that correctly finds the bus path.

Do you have any scripts that might `if...else` check if the game is playing in Editor mode? Are you able to create a small blank Unity game with the same FMOD Studio banks and see if the same issue persists?

If possible, please also share a screenshot of all the FMOD settings in Unity expanded so we can check if anything is happening there.
