FMOD Unity automation not working. FMOD bug?

Unity version: 2022.2.21f1 (also tried upgrading to 2022.3.5f1)
FMOD version: 2.02.16 (also tried 2.02.15).

Here is the problem:

  1. Created an attack event, which is a multi instrument with 2 sounds.
  2. I added “Pitch Shifter” effect to master track of the event.
  3. I added automation to “Pitch” value, which looks like this (“IsAttackCritical” is a Discrete parameter, ranging from 0 to 1, “Hold value until playback” is unchecked):
  4. I tested the sound in FMOD Studio, when IsAttackCritical == 1, it lowers the pitch, otherwise the sound is default. Seems like everything is perfect, when testing in FMOD Studio.
  5. Went to Unity, and launched this event from my project like this:
EventInstance instance = RuntimeManager.CreateInstance(eventToPlay); // eventToPlay is an EventReference
instance.setParameterByName("IsAttackCritical", IsCritical ? 1 : 0);
instance.set3DAttributes(RuntimeUtils.To3DAttributes(soundPos));
instance.start();
instance.release();

The bug: Sound is played successfully, but the pitch never changes as if “IsAttackCritical” is always 0.

What I’ve tried:

  1. Checked instance.getParameterByName() right after instance.setParameterByName() to see whether the parameter has been set to 1 successfully.
  2. Checked RESULT for every single function that returns it. Got “OK” everywhere.
  3. Tried setting FMOD log level to “Log”. Nothing suspicious there.
  4. Checked that the parameter Velocity is 0/s and Seek speed is “Instant”.
  5. Tried setting “IsAttackCritical” Initial Value to 1 and not setting it via code at all, still sounds as if IsAttackCritical is set to 0.
  6. Tried reinstalling both FMOD Studio and FMOD Unity.
  7. Tried just doing the same thing from scratch (creating new event, new parameter etc.).

Is this an FMOD bug or I haven’t checked something on my side that I need to?

Thanks in advance!!!

1 Like

Hi,

Thank you for all the information, it greatly helps resolve the issue. Unfortunately, following your code, I was not able to reproduce the issue and heard the pitch changes.

Could you please try adding the event to an FMOD Studio Event Emitter: Unity Integration | Game Components - Studio Event Emitter and assigning the Initial Parameter Value for IsAttackCritical
image
and let me know if you can hear the pitch change using the method. This is just to confirm that the parameter changes are working.

How is IsCritical being assigned? If you hard code the parameter value do you hear a pitch change?

Hey, thanks for replying!
I can confirm that parameter change is working, I actually achieved pitch change using a different approach.

Instead of adding automation to “Pitch” inside “Pitch shifter” effect, I found “Pitch” field in a different place (by just clicking on an individual instrument I found “Pitch” field under “Volume”):

When I automated it here, it worked, meaning parameter and my code worked correctly.

Maybe has something to do with “Pitch shifter” effect specifically?

1 Like

Hi,

Good to hear it is working and thank you for sharing the solution.