Parameter return to 0 after play


I change Parameter
hero.EventInstance.setParameterByName (“Surfaces”, 1);
But after one Play parameter return to 0 again.
How keep this value?

event instances should keep parameter values, unless they stop. You can prevent an event from stopping automatically by setting “Persistant” to ON in FMOD Studio. It’s a setting on the master track of the event.

Other ways to solve this:

if you want 1 to be default, change it to 1 in FMOD Studio, right click and select “Set As Initial Value”

if you want to remember the last value used, you could store it as a variable in unity.

float surfacesValue = 1f;

hero.EventInstance.setParameterByName(“Surfaces”, surfacesValue);

1 Like

Thanks a lot!