Can't get parameterValue to work

So I am having some trouble with a simple parameterScript I made for unity using fmod. Whenever the player hits a triggerbox with this script and the right values filled in it should change a parameter in Fmod. Weirdly enough it works with the first trigger box but not the 2nd. Do you have any ideas what might be the problem?

Here is my script :
using UnityEngine;
using FMODUnity;
using FMOD.Studio;

public class ParameterScriptFmod : MonoBehaviour
{

[SerializeField] private string playerTag = "Player";
[SerializeField] private string parameterName;
[SerializeField] private float parameterValue;
[SerializeField] private string fmodEventPath;


private EventInstance fmodEventInstance;

private void Awake()
{
    fmodEventInstance = RuntimeManager.CreateInstance(fmodEventPath);
}




private void OnTriggerEnter2D(Collider2D other)
{
    if (other.CompareTag(playerTag))
    {
        Debug.Log("ParamChange");
        fmodEventInstance.setParameterByName(parameterName, parameterValue);
        DestroyAudioTrigger();
        Debug.Log("ParamChange");

    }
}

private void Start()
{
    fmodEventInstance.start();
  

}

private void OnDestroy()
{
    // Release the FMOD event instance when the game object is destroyed
    fmodEventInstance.release();
}


void DestroyAudioTrigger()
{
    Destroy(gameObject);
}

}

Hi,

What version of the FMOD integration are you using?

I’d suggest using FMOD.RESULT to check the success of FMOD function calls as it aids in debugging issues like this. The full error explanation list can be found here: FMOD API | Core API Reference - Common. You’d add it to the code like so:

private void OnTriggerEnter2D(Collider2D other)
{
    if (other.CompareTag(playerTag))
    {
        Debug.Log("ParamChange");
        FMOD.RESULT result = fmodEventInstance.setParameterByName(parameterName, parameterValue);
        if (result != FMOD.RESULT.OK)
        {
            Debug.Log(result.ToString());
        }
        DestroyAudioTrigger();
        Debug.Log("ParamChange");

    }
}

Another option is changing the logging level in the FMOD integration settings:
image
Warning is a good level to make sure nothing is going missed.

Let me know if that shines any light on what is going on!