Added Launch Sound to Block Breaker game

I really wanted to add a sound when you click to launch the ball. A few google searches didn’t really help me but I persevered and found a solution myself! :smiley:

I added an extra sound to the ballSounds array in the inspector (as first sound in the list). After that I added an AudioClip to the LaunchOnMouseCLick method.

Sound added to LaunchOnMouse() screenshot

afbeelding

And finally changed the Random.Range from 0 to 1.

Random.Range change screenshot

afbeelding

Since I’m completely new to coding I’d like to know how I did with this solution to my problem!

1 Like

Privacy & Terms