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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s