# Link FMOD parameter to UI Slider in Unity

**URL:** <https://qa.fmod.com/t/link-fmod-parameter-to-ui-slider-in-unity/17147>\
**Category:** Unity\
**Created:** [May 1, 2021, 5:10pm UTC](https://qa.fmod.com/t/link-fmod-parameter-to-ui-slider-in-unity/17147 "2021-05-01T17:10:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![old\_edge](https://avatars.discourse-cdn.com/v4/letter/o/96bed5/32.png) [@old\_edge](https://qa.fmod.com/u/old_edge)\
**Post date:** [May 1, 2021, 5:10pm UTC](https://qa.fmod.com/t/link-fmod-parameter-to-ui-slider-in-unity/17147/1 "2021-05-01T17:10:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [May 3, 2021, 1:20am UTC](https://qa.fmod.com/t/link-fmod-parameter-to-ui-slider-in-unity/17147/2 "2021-05-03T01:20:20Z")

</div>

The relevant components for interacting with parameters are [StudioParameterTrigger](https://www.fmod.com/resources/documentation-unity?version=2.2&page=api-studioparametertrigger.html) (for local parameters) and [StudioGlobalParameterTrigger](https://www.fmod.com/resources/documentation-unity?version=2.2&page=api-studioglobalparametertrigger.html) (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.

---

<div class="post-metadata">

**Author:** ![old\_edge](https://avatars.discourse-cdn.com/v4/letter/o/96bed5/32.png) [@old\_edge](https://qa.fmod.com/u/old_edge)\
**Post date:** [May 3, 2021, 6:26am UTC](https://qa.fmod.com/t/link-fmod-parameter-to-ui-slider-in-unity/17147/3 "2021-05-03T06:26:19Z")

</div>

Thanks joseph!

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

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/b/be02bb1126051bf26a1c32c98247091a946fcd7c.png)

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [May 13, 2021, 5:21am UTC](https://qa.fmod.com/t/link-fmod-parameter-to-ui-slider-in-unity/17147/4 "2021-05-13T05:21:58Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![caitsavestheworld](https://avatars.discourse-cdn.com/v4/letter/c/e480ec/32.png) [@caitsavestheworld](https://qa.fmod.com/u/caitsavestheworld)\
**Post date:** [January 10, 2022, 4:57am UTC](https://qa.fmod.com/t/link-fmod-parameter-to-ui-slider-in-unity/17147/5 "2022-01-10T04:57:53Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [January 18, 2022, 4:30am UTC](https://qa.fmod.com/t/link-fmod-parameter-to-ui-slider-in-unity/17147/6 "2022-01-18T04:30:05Z")

</div>

I’m no Unity script expert, but a quick google suggests that it is possible to get [the value of a slider](https://docs.unity3d.com/560/Documentation/ScriptReference/UI.Slider-value.html) in Unity script, and that the [OnValueChanged](https://docs.unity3d.com/2017.3/Documentation/ScriptReference/UI.Slider-onValueChanged.html) method could be used to update the parameter value whenever the slider is adjusted.
