Posted May 25, 2021 by Danzy
#audio #die #sound #effect
I did something similar for the collect and die audio. For the collect sound, I created a new script and used OnTriggerEnter to detect collision with any foreign object. if the collision was detected it will play the audio collect. I used the same script for the Die and used the same principles to make it work.
For the button sound click and select sound effect. I created an empty object in the hierarchy and added the audio source button click to it.
Than in the button onClick() i added it to play the audio when the button is clicked. When the button is hovered over by the mouse. I used the Event Trigger to check when the pointer enter the button area it will be play the audio.
Lastly for the saws and gameplay audio I used the same method I used for the Prototype to just make it play on awake.