# Set Parameter from animation

**URL:** <https://qa.fmod.com/t/set-parameter-from-animation/24095>\
**Category:** Unity\
**Created:** [March 10, 2026, 10:55am UTC](https://qa.fmod.com/t/set-parameter-from-animation/24095 "2026-03-10T10:55:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rosile](https://avatars.discourse-cdn.com/v4/letter/r/c5a1d2/32.png) [@Rosile](https://qa.fmod.com/u/Rosile)\
**Post date:** [March 10, 2026, 10:55am UTC](https://qa.fmod.com/t/set-parameter-from-animation/24095/1 "2026-03-10T10:55:07Z")

</div>

Good day!

I want to change parameter value inside an AnimationEvent. My logic is “when AnimationEvent triggered - set this parameter value”.

I made a code logic but it doesn’t work. Can you explain what is my fault?

```csharp
using System.Collections.Generic;
using UnityEngine;
using FMODUnity;
using FMOD.Studio;

public class FmodAnimationGlobalParameter : MonoBehaviour
{
private readonly Dictionary<string, PARAMETER_ID> _paramCache = new();

public void SetGlobalParameter(string parameterName, float value)
{
    if (!_paramCache.TryGetValue(parameterName, out var paramId))
    {
        RuntimeManager.StudioSystem.getParameterDescriptionByName(
            parameterName,
            out var desc
        );

        paramId = desc.id;
        _paramCache.Add(parameterName, paramId);
    }

    RuntimeManager.StudioSystem.setParameterByID(paramId, value);
}

}

```

---

<div class="post-metadata">

**Author:** ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)\
**Post date:** [March 11, 2026, 10:11pm UTC](https://qa.fmod.com/t/set-parameter-from-animation/24095/2 "2026-03-11T22:11:56Z")

</div>

Hi,

Thank you for sharing the code.

> [@Rosile](#):
>
> I made a code logic but it doesn’t work. Can you explain what is my fault?

Could you please elaborate a bit more on how the code logic is not working?

If the issue is that you cannot find the method in the Animation Event function list, it is likely because [Unity AnimationEvents](https://docs.unity3d.com/550/Documentation/Manual/animeditor-AnimationEvents.html) can only call methods with zero or one parameter, while your `SetGlobalParameter(string parameterName, float value)` method takes two parameters.
