O'Reilly logo

Unity 4 Game Development HOTSHOT by Jate Wittayabundit

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

Creating a key, door, and replay button

In this step, we will create the end point (door). We will also create a trigger Collider, which will check for the condition that if the player collected the item, he/she can win the game; of course, the item's the key to open our door. At last, we will create the restart button so that we can restart the game after the game ends.

Prepare for lift off

Let's make sure that we have the sound effects setting correct by going to the SimplePlatform | Resources | Sound folder in the Project view. We will see buttonClick.aiff, doorOpen.wav, getKey.aiff, and jump.wav. Unity, by default, translates every sound that we import in our project to 3D, but we don't really need it as we are creating a 2D game. So, we will ...

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