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

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:

[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:

[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

Can someone help me understand this? :relieved:

1 Like

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.

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.

1 Like