From the course: Unity 4: 2D Essential Training
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Deadly obstacles - Unity Tutorial
From the course: Unity 4: 2D Essential Training
Deadly obstacles
So now that we have our door, our trigger, and our push block, which represent the puzzle based objects in our game, next let's take a look at how we can build some obstacles that'll actually do damage to the player. To do this, let's create a new scene, and we're going to call this deadly obstacles staging. We're going to save this to our scenes folder and from here, we're going to go to our prefab folder, we'll drag our test platform and our player into the scene. Next, let's go into the artwork, inside Sprite sheets and look for our spikes. Here, we're going to drag the single spike into the screen. We'll position this a little bit above the player. We can also name this single spike and we can drag it back into the prefab folder. Next, let's add a collider to it. Here, we'll have a box collider 2D. And we're going to set this to be a trigger. Next thing we want to do are tag any objects that'll do damage, to the player as being deadly. We can go into the Tag drop-down and select…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
Creating collectable objects2m 55s
-
Randomly selecting sprites7m 18s
-
Creating a push block4m 53s
-
Creating switches5m 29s
-
Creating a door and code7m 31s
-
Creating the door trigger6m 9s
-
Connecting the obstacles together6m 39s
-
Creating gizmos3m 29s
-
Deadly obstacles3m 47s
-
Exploding the player4m 44s
-
-
-
-
-
-
-