Bouncy Ball (Unity)

I have been working on a ball in Unity, this ball had a base code which allowed it to bounce up and down as high as I wanted it to be. Since then I have been given the task of making my own twist for the ball to put into a scene with others that people have made.

Capture.PNG

The first thirteen lines of code is the base code which allows the ball to bounce up and down, the extra lines of code is what I have added. These lines allow me to play an audio file, because the code is below the OnCollisionEnter line the sound file plays when the ball bounces on the floor of the scene.

Leave a comment