Parameters appear not to work

I’m setting up my first parameter-driven sound in FMOD+Unity and I’m obviously doing something wrong. (My questions are at the bottom. :arrow_down:)

Here’s my FMOD event. It has a single looped sample. There’s a single parameter sheet: Thrust. Thrust simply controls volume. The initial value of Thrust is 0.0.

If I play this in FMOD, it starts out silent. As I increase Thrust, I hear the sound louder.

In Unity, I have a game object in the scene with an FMOD Studio Event Emitter. My aim is to couple a FloatVariable (Ryan Hipple style ScriptableObject) to the Thrust parameter. My script takes the emitter, the name of the parameter and a reference to the FloatVariable. Each frame (in Update()), it assigns the FloatVariable value to the parameter value. That’s the idea anyway!

Screenshot 2021-05-14 at 12.05.56

  1. If I don’t click ‘Add’ for Initial Parameter Values and add Thrust, my script thinks that the emitter has no parameters. Is this right? As I’d already set the initial value in FMOD I wasn’t bothering to set it here. But it looks like I have to for the script to see it. Could someone explain please?

  2. At runtime, I can see that when the FloatVariable value changes and the Thrust value on the FMOD Studio Event Emitter is following it correctly. However I hear nothing. Any ideas?
    (I can hear all the other FMOD sound events, triggered from Action Sheets.)

Thanks!

With Q2, I should clarify that if I set the initial value of Thrust to, say 0.5, then I hear that fine. So there’s no problem with the event playing sound. The problem is that I’m changing the parameter value and I can see it change in Unity Inspector, but it doesn’t affect the sound.

I’ve worked out how to get the sound working correctly, but I don’t understand the behaviour. Please could someone explain.

In my original code (above), I saved the ‘Thrust’ ParamRef. When I changed the value on this parameterRef.Value = Source.Value, it changed the value shown for the parameter in the FMOD Studio Event Emitter in the Inspector, but didn’t alter the sound.

I have replaced this with the call studioEventEmitter.SetParameter(parameterRef.ID, Source.Value). This audibly changes the sound, as intended, but nothing changes in the Inspector.

Obviously I need to keep the latter code, but I’d like to understand more about what’s going on, why the original code didn’t work and why the latter code doesn’t change the parameter value in the inspector. Thanks!

ParamRef is just a struck, you can modify the value of it but the integration only uses it for the initial value when the event is started. As you have discovered, after that you would use StudioEventEmitter.SetParameter().

Edit: Just to clarify - the original code is just manipulating the initial value used, which in turn adjusts the slider in the inspector. When using StudioEventEmitter.SetParameter() it will not adjust this slider.