O'Reilly logo

Unity 3 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 and door

In this step, we will create the finish point, which is the door in this case. We will also create a Trigger Collider, which makes it so that the player can't end the game if he/she didn't collect our item; of course it's the key to our door.

Prepare for Lift Off

Let's prepare and make sure that we have all the graphics that we need; go to the Graphics folder in the Project window, and make sure in our subfolder Level, we have doorClose.png, doorOpen.png, and key.png. Let's get start.

Engage Thrusters

Here, we will create the object's Key and Door. Let's do this as follows:

  1. Let's create the new material for our key, so go to Assets | Create | Material, name it M_Key, and set the following:
    • Shader: Transparent | Cutout | Specular ...

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