Change parameter by ID not working

Hi, below is a script that I have attached to my character, and everything in the script is working except for the part that sets the parameter. It is playing the default parameter value 0, rather than 4, every time PlayFootstep is called:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CharacterSounds : MonoBehaviour
{
[FMODUnity.EventRef]
public string inputsound;
FMOD.Studio.EventInstance sound1;
[FMODUnity.EventRef]
public string inputsound2;
FMOD.Studio.EventInstance sound2;
FMOD.Studio.PARAMETER_ID surfaceID;

void Start()
{

    FMOD.Studio.EventDescription eventDescription;
    sound1.getDescription(out eventDescription);
    FMOD.Studio.PARAMETER_DESCRIPTION surfaceDescription;
    eventDescription.getParameterDescriptionByName("Surface", out surfaceDescription);
    surfaceID = surfaceDescription.id;
}


void PlayFootstep()
    {
    float valu = 4;
    sound1 = FMODUnity.RuntimeManager.CreateInstance(inputsound);
    sound1.setParameterByID(surfaceID, (float)valu);
    sound1.start();
    FMODUnity.RuntimeManager.AttachInstanceToGameObject(sound1, GetComponent<Transform>(), GetComponent<Rigidbody>());
}      

}

I think you are trying to call getDescription on sound1, but that instance only get’s created when you call PlayFootstep. Try to move the parameter code below the instance creation or maybe call FMODUnity.RuntimeManager.GetEventDescription to get the EventDescription instead.

I previously had these lines:

FMOD.Studio.EventDescription eventDescription;
sound1.getDescription(out eventDescription);
FMOD.Studio.PARAMETER_DESCRIPTION surfaceDescription;
eventDescription.getParameterDescriptionByName(“Surface”, out surfaceDescription);
surfaceID = surfaceDescription.id;

in void update like the API manual suggests, and it did not work that way either. What is the difference between getDescription and getEventDescription?

Moving the parameter code below the instance creation in void PlayFootsteps also does not change the problem.

it is a global parameter fyi

For global parameters you might want to look at Studio::System::getParameterDescriptionByName and Studio::System::setParameterByID. Global parameters exists on global basis on the System object as detailed here: https://www.fmod.com/resources/documentation-api?version=2.0&page=studio-guide.html#setting-parameters
You can get the Studio System object through the RuntimeManager in Unity. The code would look like this if I remember correctly:

FMOD.Studio.PARAMETER_DESCRIPTION surfaceDescription;
FMODUnity.RuntimeManager.StudioSystem.getParameterDescriptionByName(“Surface”, out surfaceDescription);
surfaceID = surfaceDescription.id;

then you just call:

FMODUnity.RuntimeManager.StudioSystem.setParameterByID(surfaceID, value);