Button Press And Release Sounds
This one's short. In Unity, I have a button and I want it to play one sound on press, and another on release, like in Cookie Clicker. Problem is, I use C Sharp. Please help, and thanks!
Answer by TonyLi · Jun 21, 2017 at 06:10 PM
Add an Audio Source to your button.
Add an Event Trigger component to your button.
Assign the Audio Source to the OnPointerDown and OnPointerUp events, and configure them to call PlayOneShot with the sounds you want to play.
Answer by R_The_Voxeler · Jun 21, 2017 at 06:33 PM
WOAH THAT WAS SUCH A SANICALLY FAST POST!!1!!111! Thank you, you make the Unity community better every day. You're teh best!
Your answer
Follow this Question
Related Questions
Press and Release? New InputSystem 1 Answer
What's wrong with my audiostream on android? 0 Answers
LoadScene not Working 1 Answer
Get keycode of pressed button 1 Answer
About button press sprint 1 Answer