Button Sound Tutorial
Button Sound Tutorial
Step 2. Set this new Gameobject’s position to 0, 0, 0 in the inspector so it resides next to
the Main Camera. Alternatively, you could child it to the camera.
Step 4. Make your new Gameobject an Audio Source by Adding the Audio Source
Component it.
Add Component > Audio > Audio Source
Step 5. Add the sound you would like to play when you mouseover your buttons to the
Audio Source Component, in the Audio Clip slot.
In my case, I used a sound called “ui_select_2”.
Step 6. In your Hierarchy view, Go to the UI Canvas and select the button you wish to
add mouseover sounds to.
Step 9. In the Event Trigger Component you just added, click the plus sign (+) in the
bottom right corner to add a new Pointer Enter event to the list.
Step 10. In the Event Trigger Component, Choose when the event should occur.
In my case I chose only at Runtime.
Drag your buttonSounds Gameobject from the Heirarchy view that we created in Steps
1 through 5, to the Event Triggers Object Slot.
Step 11. In the Event Trigger Component, Add a PlayOneShot (AudioClip) funtion.
Step 12. Press play and mouse over your button to enjoy bringing your UI to life with
sound events!
NOTES
If you are using different sounds for each button, this entire provcess needs to be
repeated for each button.
If you want a sound to play when you press your button, simply do steps 1 - 5.
Then in the onClick event provided with Atavism, add a new event and do the
triggering there!