# StudioEventEmitter - ParamRef\[\] Params

**URL:** <https://qa.fmod.com/t/studioeventemitter-paramref-params/12641>\
**Category:** Unity\
**Created:** [August 9, 2016, 4:13pm UTC](https://qa.fmod.com/t/studioeventemitter-paramref-params/12641 "2016-08-09T16:13:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vhasselmann](https://avatars.discourse-cdn.com/v4/letter/v/43a26b/32.png) [@vhasselmann](https://qa.fmod.com/u/vhasselmann)\
**Post date:** [August 9, 2016, 4:13pm UTC](https://qa.fmod.com/t/studioeventemitter-paramref-params/12641/1 "2016-08-09T16:13:14Z")

</div>

Hello,

I’ve been working with FMOD since Unity 4.x and have improving skills with the IDE as it evolves. Currently, i’m using the new 1.08.09v and making a new integration to our game on our Studio.

I’m getting a NullReferenceException in ParamRef[] Params by creating a dynamic StudioEventEmitter as the game needs with a static function:

```
public static StudioEventEmitter CreateEmitter(GameObject obj, string eventToCreateFrom, bool triggerAtStart = false)
    {
        StudioEventEmitter emitter;
        emitter = obj.AddComponent<StudioEventEmitter>();
        string eventAsset = eventToCreateFrom.ToLower();
        emitter.Event = eventAsset;
        emitter.TriggerOnce = triggerOnce;

        if(triggerAtStart)
        {
            emitter.Play();
        }

        return emitter;
    }

```

My question is: Should i initialize the emitter.Params empty or it’s a bug? My event does not have any parameter.

Thank you.

---

<div class="post-metadata">

**Author:** ![vhasselmann](https://avatars.discourse-cdn.com/v4/letter/v/43a26b/32.png) [@vhasselmann](https://qa.fmod.com/u/vhasselmann)\
**Post date:** [August 9, 2016, 4:26pm UTC](https://qa.fmod.com/t/studioeventemitter-paramref-params/12641/2 "2016-08-09T16:26:14Z")

</div>

Hello,

I added emitter.Params = new ParamRef[0]; to my code and even if the event has or not params, it seems to work properly now. So, use this as a recomendation if you are creating dynamic emitters in your game.

Thank you.

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [August 10, 2016, 3:48am UTC](https://qa.fmod.com/t/studioeventemitter-paramref-params/12641/3 "2016-08-10T03:48:40Z")

</div>

I’ve fixed this up in the next official release.

But unlike the Unity audio system and it’s requirement that you create an AudioSource component before playing a clip, in FMOD we recommend you play events directly in code (EventEmitter is still fine for placing at design time).

See the [Scripting Basics](http://www.fmod.org/documentation/#content/generated/engine_new_unity/script_example_basic.html) example.

---

<div class="post-metadata">

**Author:** ![vhasselmann](https://avatars.discourse-cdn.com/v4/letter/v/43a26b/32.png) [@vhasselmann](https://qa.fmod.com/u/vhasselmann)\
**Post date:** [August 10, 2016, 5:28am UTC](https://qa.fmod.com/t/studioeventemitter-paramref-params/12641/4 "2016-08-10T05:28:08Z")

</div>

> [@](#):
>
> I’ve fixed this up in the next official release.
> 
> But unlike the Unity audio system and it’s requirement that you create an AudioSource component before playing a clip, in FMOD we recommend you play events directly in code (EventEmitter is still fine for placing at design time).
> 
> See the [Scripting Basics](http://www.fmod.org/documentation/#content/generated/engine_new_unity/script_example_basic.html) example.

Hello Nicholas, thanks for your reply.

I saw that a couple of things changed from older versions of FMOD. Your link is really useful and I will take a note about not create emitters and track everything with event instances by code
