# Change parameter value continuosly

**URL:** https://qa.fmod.com/t/change-parameter-value-continuosly/12898
**Category:** Unity
**Created:** [December 28, 2016, 10:22am UTC](https://qa.fmod.com/t/change-parameter-value-continuosly/12898 "2016-12-28T10:22:51Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![DDAUDIOSOLUTIONS](https://avatars.discourse-cdn.com/v4/letter/d/58f4c7/32.png) [@DDAUDIOSOLUTIONS](https://qa.fmod.com/u/DDAUDIOSOLUTIONS)
#### Post date: [December 28, 2016, 10:22am UTC](https://qa.fmod.com/t/change-parameter-value-continuosly/12898/1 "2016-12-28T10:22:51Z")

</div>

Hi, i have a music in my player, and when the health level down, i modify the parameter in the music in fmod, to increment the LPF with this script:

if (playerHealth.currentHealth \<= 80) {  
FondoMusica.setParameterValue (“Health2”, 5); //variamos el valor del parametro de fmod, a partir de los valores que tenemos en el parametro de fmod.  
}  
if (playerHealth.currentHealth \<= 70) {  
FondoMusica.setParameterValue (“Health2”, 6); //variamos el valor del parametro de fmod, a partir de los valores que tenemos en el parametro de fmod.  
}  
if (playerHealth.currentHealth \<= 60) {  
FondoMusica.setParameterValue (“Health2”, 6); //variamos el valor del parametro de fmod, a partir de los valores que tenemos en el parametro de fmod.  
}  
if (playerHealth.currentHealth \<= 50) {  
FondoMusica.setParameterValue (“Health2”, 7); //variamos el valor del parametro de fmod, a partir de los valores que tenemos en el parametro de fmod.  
}  
if (playerHealth.currentHealth \<= 40) {  
FondoMusica.setParameterValue (“Health2”, 8); //variamos el valor del parametro de fmod, a partir de los valores que tenemos en el parametro de fmod.  
}  
if (playerHealth.currentHealth \<= 30) {  
FondoMusica.setParameterValue (“Health2”, 9); //variamos el valor del parametro de fmod, a partir de los valores que tenemos en el parametro de fmod.  
}  
Are there some way to make this gradually with some kind of code line?

thanks

---

<div class="post-metadata">

### Author: ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)
#### Post date: [December 29, 2016, 1:06am UTC](https://qa.fmod.com/t/change-parameter-value-continuosly/12898/2 "2016-12-29T01:06:31Z")

</div>

You could set the parameter value in Studio to line up with the game. So that the part you want to play at 20 uses a value of 20, then just set the parameter to the current health value.

---

<div class="post-metadata">

### Author: ![mozq8](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@mozq8](https://qa.fmod.com/u/mozq8)
#### Post date: [January 4, 2017, 4:44pm UTC](https://qa.fmod.com/t/change-parameter-value-continuosly/12898/3 "2017-01-04T16:44:02Z")

</div>

> [@](#):
>
> You could set the parameter value in Studio to line up with the game. So that the part you want to play at 20 uses a value of 20, then just set the parameter to the current health value.

Can u describe how to do it please?

---

<div class="post-metadata">

### Author: ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)
#### Post date: [January 4, 2017, 10:42pm UTC](https://qa.fmod.com/t/change-parameter-value-continuosly/12898/4 "2017-01-04T22:42:44Z")

</div>

answered at [https://www.fmod.org/questions/question/fmod-parameter-to-unity/](https://www.fmod.org/questions/question/fmod-parameter-to-unity/)
