setParametersByName not setting(?)

Hi people, I am new to FMOD and especially C#/Unity.
I am trying everything I can here but I can’t change the parameter by a script (I know FMOD comes with one but I trying to build my own).

But my setParameterByName and getParameterByName are not connecting to the event. The set event is not setting anything, and getting is just getting 0, don’t matter the value I input the start in FMOD.

Here is my code if anyone can help me :slight_smile: I am at least 4 - 5 hours in it and have no clue

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

public class ChangeMaterialFS : MonoBehaviour
{
public float val;
FMOD.Studio.EventInstance StepFoot; // Stepfoot is a variable that the type is a fmod somthing
void Start()
{
    StepFoot = FMODUnity.RuntimeManager.CreateInstance("event:/Footstep"); // Stepfoot is a specific event in FMOD
}

private float debuguing = -1;
private void OnTriggerEnter2D(Collider2D other)
{
    if (other.CompareTag("Player"))
    {
        print("setting to "+val);
        StepFoot.setParameterByName("Material", val, true); // Set Material to val
        StepFoot.getParameterByName("Material", out debuguing); // Set Material to val
        print("getting   :"+debuguing);
    }
}
}

Why don’t you look at the API calls in FMOD Studio with liveupdate?

How do I do this[ look at the api calls, I am able already to put in live update] is in the profiler window?

Third button up-middle of the screen.

nothing shows up there, If I record a list of every frame comes up with many things, Idk how I would search there… But to the code is anything funny? I am sure I am setting to the right path, actually I can control it in the Unity FMOD Event browser and test with the play button copy the path everything should be okay /sniff…

You should set the timeline just before the sound appears in the wave form, then go to the API calls tab and check every following frames. You should see (or not) setParameterByName and other functions called.

Ok people thanks I solved changing the structure of how I was playing my footstep sounds how how chaning the parameter value

1 Like