# Trying to use different events in a single emitter does not works

**URL:** <https://qa.fmod.com/t/trying-to-use-different-events-in-a-single-emitter-does-not-works/20382>\
**Category:** Unity\
**Tags:** unity, csharp\
**Created:** [July 4, 2023, 4:16pm UTC](https://qa.fmod.com/t/trying-to-use-different-events-in-a-single-emitter-does-not-works/20382 "2023-07-04T16:16:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![3DMagicVR](https://avatars.discourse-cdn.com/v4/letter/3/cdc98d/32.png) [@3DMagicVR](https://qa.fmod.com/u/3DMagicVR)\
**Post date:** [July 4, 2023, 4:16pm UTC](https://qa.fmod.com/t/trying-to-use-different-events-in-a-single-emitter-does-not-works/20382/1 "2023-07-04T16:16:18Z")

</div>

Hello and good day.

I’m trying to use a single event emitter to manage diferent events, but when I do it, only the first assigned event keeps playing (when it’s invoked using the Play at the moment and later on), this is the way I do it:

```auto
public StudioEventEmitter emitter;
public EventReference eventA;
public EventReference eventB;

public void PlayEventBy(bool isB)
{
	if (!isB)
	{
		emitter.EventReference = eventA;
	}
	else
	{
		emitter.EventReference = eventB;
	}

    emitter.Play()
}

```

My quetion here is: How can I solve this or it’s not possible?, I know I can use multiple components to manage that (actually I have to do it), but I want to know if the other option it’s allowed or not, thanks for you attention.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [July 5, 2023, 12:46am UTC](https://qa.fmod.com/t/trying-to-use-different-events-in-a-single-emitter-does-not-works/20382/2 "2023-07-05T00:46:05Z")

</div>

Hi,

What version of FMOD are you using?

This is possible by commenting out a few lines in the `Studio Event Emitter`, but this isn’t how the emitters were intended to be used. Could you elaborate and the behavior you are trying to achieve and maybe we could find an alternative solution?

The lines that need to be commented out are `196, 197, 199, 227, 228, and 230` in `StudioEventEmitter.cs`. These lines are checking if there is already a valid `Event Description` and `Event Instance` attached to the emitter.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![3DMagicVR](https://avatars.discourse-cdn.com/v4/letter/3/cdc98d/32.png) [@3DMagicVR](https://qa.fmod.com/u/3DMagicVR)\
**Post date:** [July 5, 2023, 6:31pm UTC](https://qa.fmod.com/t/trying-to-use-different-events-in-a-single-emitter-does-not-works/20382/3 "2023-07-05T18:31:18Z")

</div>

Hi, thanks for the reply.

Well, I managed in a different way (checking the documentation), fortunately I found a very good solution for my case, once again, thanks and have a nice day.
