# Set Parameter with Send Message

**URL:** <https://qa.fmod.com/t/set-parameter-with-send-message/17973>\
**Category:** Unity\
**Created:** [November 16, 2021, 1:53pm UTC](https://qa.fmod.com/t/set-parameter-with-send-message/17973 "2021-11-16T13:53:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flashbox](https://avatars.discourse-cdn.com/v4/letter/f/8dc957/32.png) [@Flashbox](https://qa.fmod.com/u/Flashbox)\
**Post date:** [November 16, 2021, 1:53pm UTC](https://qa.fmod.com/t/set-parameter-with-send-message/17973/1 "2021-11-16T13:53:58Z")

</div>

Hi!

I was wondering if there is any way to set a parameter through the send message function in the Studio Event Emitter?

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [November 22, 2021, 11:37pm UTC](https://qa.fmod.com/t/set-parameter-with-send-message/17973/2 "2021-11-22T23:37:31Z")

</div>

[`SendMessage`](https://docs.unity3d.com/ScriptReference/GameObject.SendMessage.html) is a feature of Unity GameObjects that allows you to call any method on a GameObject, but it is restricted to sending a single value so you would need to make a wrapper function to call [`StudioEventEmitter.SetParameter`](https://fmod.com/resources/documentation-unity?version=2.02&page=api-studioeventemitter.html#studioeventemitter_setparameter):

```auto
// CallerScript.cs
gameObject.SendMessage("SetParameterWrapper", new { name = "Size", value = Random.Range(0.0f, 3.0f), ignoreseekspeed = false});
...
// StudioEventEmitter.cs
public void SetParameterWrapper(object o)
{
    string name = (string)o.GetType().GetProperty("name").GetValue(o, null);
    float value = (float)o.GetType().GetProperty("value").GetValue(o, null);
    bool ignoreseekspeed = (bool)o.GetType().GetProperty("ignoreseekspeed").GetValue(o, null);

    SetParameter(name, value, ignoreseekspeed);
}

```

Relying on SendMessage would violate good software design principles and is relatively expensive/convoluted compared to just [calling SetParameter on the StudioEventEmitter itself](https://fmod.com/resources/documentation-unity?version=2.02&page=game-components.html#studio-parameter-trigger), so use it sparingly!
