What you will learn
In this Unity tutorial, we will learn how to effectively utilize the game engine. Over the tutorial, we will learn how to use the Unity editor interface as well as how to navigate in the scene view. From there, we will learn how to import assets and how to create prefabs. Then we will shape our level even more by adding character controllers, colliders, lights, materials and physics. We will then finish the tutorial by learning how to use scripting in order to make our level interactive.
In this lesson, we're going to go ahead and finish up the base structure of our level by creating the interior rooms of this level. OK, so I've gone ahead and just placed those doorways, and just used those prefabs. Just snapped them right up against that wall, and then just kind of lined them up a little bit better using the move tool. Just making sure that the bases of the doorways aren't actually showing any holes. So for example, if you snapped it, you might have a gap like this. So just kind of bring that forward, just to where it lines up a little bit better. Now again, you don't have to be exact. Whenever we're adding small details like this, it's just about making it pretty and making it look right. So let's go ahead and get into building our interior rooms. So I've already got this planned out a little bit. And hopefully, if you're designing your own level, you've got some sort of drawing or sketch to go by. And seeing how I've already designed this level, I'm going to actually have a room right here. And then I'm going to have another room over here. And a smaller one here, and a kind of longer one here as well. So these are just going to fit right inside of this area. So let's go ahead and actually start snapping in some floors to really just kind of get an idea of what our rooms are going to look like, and about the size that they're going to look. So let's go ahead and just collapse our prefabs there. We're going to go to Meshes. And I'm going to go to my Floors folder. So I'm going to go to floor 2. And this is just a flat plane here for my floor. If I go to floor 3, I've got a little bit of a different type of shape here. And I just created this for a specific wall that I have inside of my scene. So I'm not really going to use this one all that much. So I'm going to floor 2. And I'm just using this flat one. And I'm going to go ahead and drag this into my scene here. Now let's go ahead and drag this down, get this a little bit closer to our floor. And let's just snap this in. Now what I want to do here is go ahead and snap this right up against this doorway here. And if it helps you, what I'm going to do is actually move this doorway, just kind of move it off out of the way here. And I'm going to actually snap this right along this section, right before it gets to the curve. So I'm going to hold down v, and I'm going to go down and snap it right to this point here. Now, sometimes whenever we have materials like this, when we have this grey material, it's kind of hard to see where things are going to snap to. So this is a great way to go ahead and use the wire frame. Or you could use the texture wire frame. So that way you can see this at the same time. So I'm actually going to go ahead and work with this because this could be a little bit easier whenever I'm snapping stuff together. Now if you don't like this, go ahead and change it back to the textured or to the wire frame, whichever you prefer. So now that I've got that, let's bring my doorway back here. And I'm going to try to get lined up as closely as possible again. Just kind of snap that back. And again, this is kind of overlapping. So I'm going to pull this back just a little bit. And let's check the other side of this wall here. And this is pretty good here. Again, we're not trying to get exact or anything like that. And actually, let me put it back to where I had it. And I'm pretty close, I don't really have to do this. But just kind of snap it right up against this wall here. So just to make sure that that's nice and even, and I don't get any weird or odd shadows. So I've got this floor object in. So let's duplicate this one. Hold down Control and D. And let's snap this right up against this one here. Now I'm going to go ahead and select both of these, Control D on those. And then snap those right up against this set here. So I have a pretty large room ready to go here. So let's go ahead and build the walls for this interior room. So on this one, I'm going to go ahead and use the wall 1. There's our wall objects and wall 1. Drag this one in. And let's use our vertex snapping, just butt it right up against this doorway here. And that's going to look really nice and neat there. OK, so our next we're going to use wall 2. And let's kind of rotate around here so we can see that, just to make sure that we have the right one. And let's click and drag this in here. And let's rotate this around. And there it is, just kind of orbiting around to where we find our wall. So let's rotate this 90 degrees. And let's go ahead and snap this right up against our wall right here. So I'm going to go down to my move tool, hitting W on the keyboard. Hold down V and vertex, snap that right up against here. So I'm just basically making a square room. So let's do Control D, move this, and we'll do vertex snapping right up against this point here. So let's go ahead and select both of these, Control D to duplicate. And let's rotate it 180 degrees, holding down Control to snap that. And now let's go ahead and snap this right up against this wall here, or the edge of the floor there. Let's select both of our objects, hold down V, and there we go. So we'll do that one more time for this back wall. And you'll see that you'll start to get better practice at finding ways to use existing objects and manipulating the level to where you get a really nice and neat look just from duplicating objects. This is kind of what we call modular level design, to where we use very few pieces to create a complex level. Now the final thing to do with this room is to actually go ahead and build the ceiling. So let's bring in our ceiling 1 object. Just bring that in. And I'm going to go ahead and snap it to this corner right to this wall. Now you'll notice that we have a little bit of a gap there. So I'm just going to use my y direction and drag that down. And just to where it looks good, so I don't have that gap any longer. So now I can go ahead and Control D this just to duplicate it. And hold down V and snap that to there. Now we're going to select both of these, use Control D to duplicate. And let's go ahead and hold down V, snap that together. Now again, I know that we're using a lot of the same tools and we're talking about creating this level. But again, creating levels is very simple. About moving objects and transforming objects together is very, very simple. This portion of just design is just really great. So this is the really fun part about level design. So now, let's go ahead and let's build our other rooms here. So what I'm going to do is go ahead and build a floor here. And let's just kind of create a longer room here. So I'm going to actually duplicate this one. Hold down Control and D, and move this over here. Now, I'm going to go ahead and move this doorway, just to get it out of the way so I can snap it right up against this right here. So let's select our object here, hold down V, snap it right up against that point. Now let's move our doorway back. Again, we're just watching those gaps right up against this point here. Make sure that's closed. All right, let's take this floor object, let's duplicate it. Hold Control D. And we're going to hold down V and snap that right up against there. Now I'm going to go ahead and just keep it to this size here. I could go one more if I want to do that, but I'm just going to leave it at this size. So I'm going to go ahead and leave the walls and ceiling off of this because you can go ahead and do that. But what I want to do is go ahead and just lay out the floors, so that way you have an idea of the layout of the rest of this. So let's select these two floors. So let's select this one and this one. Hold down Control D and duplicate it. And I'm going to move these right up to this point here. So again, let's move this doorway out of the way, so we can snap this nice and easy. Hold down V and snap that right in there. Let's move our doorway back. And let's just make sure that gap is closed right there. And now finally, let's go ahead and select this object and duplicate it. And we're going to put it right here on this doorway. This is a very small room here that we're creating. Let's take our doorway, move it out of the way. And again, we're getting pretty repetitive here, I know. And we're just about finished with our base layout here. So let's go ahead and push this back. And there's our doorway in place. And we are now actually finished with our base layout. So we've got a good idea of what our level is going to look like. And You know what? I'm pretty happy with this, the way it's turning out. So what we're going to do now is I'm going to go ahead and let you finish out the walls, however you see fit. I'm just going to go ahead and use these flat walls here. I might use like that wall 1 with that detail, that metal detail that we have on the sides of it. I might use that in a room or two. But you can go ahead and create the walls for the rest of these rooms in between this lesson. And what we're going to do in our next lesson is actually create our character controller. So that way we can start play testing in our level, and kind of seeing if the level is fun, how long it's taking us to get around the level. And just doing a little bit of play testing on the design. So we're going to do that in our next lesson.