How do I NOT play a sound on the first selected button.

Hi guys,

I’m struggling with my main menu. I figured out how to do the selection including sounds (works great), but I do NOT want to play a sound on the first selected button. I use an explicit navigation on my button and an event trigger (select). This is KEYBOARD INPUT only, NOT mouse!

I can’t find any information on this other than an old post from someone with the same issue but no replies…

Any idea?

It sounds like you need to have a boolean that is set to false by default and set to true after your explicit navigation event happens. Once it is true you play sounds, but when it is false you don’t.

Thanks for the reply. That was my first thought as well, but that didn’t work :frowning: I think I need to use the UnityEngine.EventSystems namespace in order check if the button is selected. Also I need to implement an interface ISelectHandler.

I found a similar post:

I hooked it up but the console is not spitting anything out. If I can figure this out then I could use a bool to bypass the first sound.

Thus far I have:

 public void OnSelect(BaseEventData eventData)
        Debug.Log( + " was selected");

but on which gameObject do I put this script (or reference)?

I was having this issue as well - not sure if it is good practice, but instead of using the Select Event Trigger, I moved to using Deselect.

It doesn’t feel quite right in my mind but is working for simple menu sounds no mouse is involved.