O'Reilly logo

Unity 3D Game Development by Example by Ryan Henson Creighton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

What's the catch?

Using the same method that you used earlier, you should be able to figure out how to add that "catch" sound effect to the player Character when he catches a beer stein. Likewise, you want to enable the explosion1 sound effect if the player gets hit by a bomb. If you can't figure it out on your own, take a deep breath, and then go nag someone else to figure it out for you. That's called delegating, and it's a perfectly legit way to develop a game.

Tip

Perfect for smashing

Unity has all kinds of complex sound controls for playing music and other effects, but like the One Shot setting for Particle Systems, the audio.PlayOneShot command is perfect for collision sound effects. If you'd like to learn more about adding sounds and music ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required