Link FMOD parameter to UI Slider in Unity

Hey community,

I have a hard time finding out what I have to do in detail to link a parameter from FMOD to a UI Slider value.

  • Do I have to use a script for this or are there solution that solely work via components?
  • If a script is needed, is there a chance you guys could write the code I need for linking the values, as I am a beginner and I assume this is a simple code for people who know their stuff. What do you think?

I am super grateful for any helping answer!

Thanks guys. Stay healthy!

Best regards
old_edge

The relevant components for interacting with parameters are StudioParameterTrigger (for local parameters) and StudioGlobalParameterTrigger (for global parameters). Both are described in detail in our documentation, along with the relevant function calls should you wish to interact with parameters using code.

Thanks joseph!

This is reassuring. Still I fail to understand how I can link these two values:

Given that you want to be able to set the parameter value to an arbitrary value based on a slider’s position, you will need to write a Unity script that, when the UI slider is adjusted, gets the value of the slider and sets the value of the parameter to that value.

Is there any specific part of this process that you’re having trouble with?

I also would simply like to link a UI slider to an FMOD parameter and do not have the faintest clue how to start that script. What method would be used to tell the parameter that its value is coming from the current position of the slider?

I’m no Unity script expert, but a quick google suggests that it is possible to get the value of a slider in Unity script, and that the OnValueChanged method could be used to update the parameter value whenever the slider is adjusted.

1 Like