# Failed to set global parameter when bank is not loaded at RuntimeManager initialization

**URL:** <https://qa.fmod.com/t/failed-to-set-global-parameter-when-bank-is-not-loaded-at-runtimemanager-initialization/20363>\
**Category:** Unity\
**Created:** [June 29, 2023, 1:52pm UTC](https://qa.fmod.com/t/failed-to-set-global-parameter-when-bank-is-not-loaded-at-runtimemanager-initialization/20363 "2023-06-29T13:52:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![juzdepeche](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@juzdepeche](https://qa.fmod.com/u/juzdepeche)\
**Post date:** [June 29, 2023, 1:52pm UTC](https://qa.fmod.com/t/failed-to-set-global-parameter-when-bank-is-not-loaded-at-runtimemanager-initialization/20363/1 "2023-06-29T13:52:36Z")

</div>

Hi,

When my game boots, I have a StudioBankLoader components that loads my banks (including Master and Master.strings). I have a coroutine that checks if all the banks were loaded, then I set a global parameter from a StudioGlobalParameterTrigger like this:

```auto
[SerializeField] private StudioGlobalParameterTrigger _musicVolumeParameter;

private IEnumerator SetPlayerPrefsOptionsCoroutine(float intensity)
{
       // We wait so all the banks are loaded
       while (!RuntimeManager.HaveAllBanksLoaded)
       {
                yield return null;
       }

       _musicVolumeParameter.Value = intensity;
       _musicVolumeParameter.TriggerParameters();
}

```

But I get this error:

```auto
[FMOD] StudioGlobalParameterTrigger failed to set parameter MusicVolume_Fader : result = ERR_EVENT_NOTFOUND

```

One thing I noticed is that if I load the **Master bank** at the RuntimeManager initialization, it works. How? Why it doesn’t work even though I check if HaveAllBanksLoaded before using the global parameter??

![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/d/dc63f5f8019a981b01eae0e2d342bb680e7c617f.png)

Can someone help me understand this? 😌

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [June 30, 2023, 3:48am UTC](https://qa.fmod.com/t/failed-to-set-global-parameter-when-bank-is-not-loaded-at-runtimemanager-initialization/20363/2 "2023-06-30T03:48:02Z")

</div>

Hi,

The issue is the `Global Parameter Trigger Script` is silently failing in its awake function. I have passed this on to our development team to look into further. Thank you for bringing this to our attention.

In the meantime, you can add the `Lookup()` function to the `TriggerParameters()` function to make sure you have a valid parameter.

```auto
public void TriggerParameters()
{
    FMOD.RESULT result = Lookup();
    if (result != FMOD.RESULT.OK)
    {
        Debug.Log(result.ToString());
    }

    if (!string.IsNullOrEmpty(Parameter))
    {
        result = RuntimeManager.StudioSystem.setParameterByID(parameterDescription.id, Value);
        if (result != FMOD.RESULT.OK)
        {
            RuntimeUtils.DebugLogError(string.Format(("[FMOD] StudioGlobalParameterTrigger failed to set parameter {0} : result = {1}"), Parameter, result));
        }
    }
}

```

If there are any updates on the issue I will let you know.
