# Can EventReferences be explicitly set to nothing so it doesn't give a warning?

**URL:** <https://qa.fmod.com/t/can-eventreferences-be-explicitly-set-to-nothing-so-it-doesnt-give-a-warning/21223>\
**Category:** Unity\
**Tags:** unity\
**Created:** [February 10, 2024, 7:22pm UTC](https://qa.fmod.com/t/can-eventreferences-be-explicitly-set-to-nothing-so-it-doesnt-give-a-warning/21223 "2024-02-10T19:22:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ProgramGamer](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/programgamer/32/6175_2.png) [@ProgramGamer](https://qa.fmod.com/u/ProgramGamer)\
**Post date:** [February 10, 2024, 7:22pm UTC](https://qa.fmod.com/t/can-eventreferences-be-explicitly-set-to-nothing-so-it-doesnt-give-a-warning/21223/1 "2024-02-10T19:22:58Z")

</div>

When an event reference is left blank in unity, the inspector shows a warning, which is fair enough as a measure to avoid bugs, but sometimes not having an event specified for a given field isn’t an error. Is there something one can put in the event reference field to suppress the warning but still set the internal GUID to nil?

---

<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:** [February 12, 2024, 4:26am UTC](https://qa.fmod.com/t/can-eventreferences-be-explicitly-set-to-nothing-so-it-doesnt-give-a-warning/21223/2 "2024-02-12T04:26:24Z")

</div>

Hi,

Are you using a [Studio Event Emitter](https://fmod.com/docs/2.02/unity/game-components.html#studio-event-emitter) or just and `public FMODUnity.EventReference`?

If you wish to remove the warning completely then you can change some code in the `EventRefDrawer.cs`. However, this is not recommended. If you are using an `EventReference` you could make it `private` so that it does not show in the editor.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![ProgramGamer](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/programgamer/32/6175_2.png) [@ProgramGamer](https://qa.fmod.com/u/ProgramGamer)\
**Post date:** [February 12, 2024, 2:06pm UTC](https://qa.fmod.com/t/can-eventreferences-be-explicitly-set-to-nothing-so-it-doesnt-give-a-warning/21223/3 "2024-02-12T14:06:11Z")

</div>

As per the title of my post, I’m using an EventReference in my own MonoBehaviour class, yes, not the builtin event emitter. Making the event reference private wouldn’t achieve anything good since I’d then lose the ability to set its value in the inspector, which is the entire point of having it in my class in the first place.

Point is, I recognize that the warning is there for a good reason, I just really wish there was a way to suppress it only in cases when a lack of a sound event is desired.

---

<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:** [February 18, 2024, 9:51pm UTC](https://qa.fmod.com/t/can-eventreferences-be-explicitly-set-to-nothing-so-it-doesnt-give-a-warning/21223/4 "2024-02-18T21:51:37Z")

</div>

Hi,

Thank you for the information.

You can hide the warning by commenting the line `218` in `EventRefDrawer.cs`.
