From the course: Unity 5: 2D Level Design

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create switches

Create switches - Unity Tutorial

From the course: Unity 5: 2D Level Design

Start my 1-month free trial

Create switches

- [Narrator] So now that we have our door and we're able to open our door as the player flies near it, let's talk about switches. Switches are usually used to open up areas that are off screen. What we're going to start doing is building a switch that we can use to trigger the door. First, we're going to need to create the switch's animations. Let's zoom out a little bit of our map and go to the second room. Next, let's go to the Jetroid Level Design folder inside of Artwork and inside of obstacles, at the bottom, we'll see our switch animations. Let's select all three of the sprites and drag them on to our map. Let's go into our Animations folder and we're going to call this SwitchDownAnimation and let's save it. While we're working with the switch game object, let's go ahead and rename the switch. We'll also want to drag this to our Prefab folder. Next, we'll want to create a switch idle animation. Let's go to our switch and in the animation window, create a new clip. Here, we're…

Contents