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 get started with our project by creating a brand new project. And then we're going to also work with importing our packages into our project. OK, so let's go ahead and start fresh. So let's go to File and New Project, and what I want to do is actually go ahead and just put it right on the C drive. And the way I'm going to do this is I'm actually going to hit Browse, and we're going to go to our hard drive, our C drive here. And I'm going to create a brand-new folder here. So I'm just going to right-click in New Folder, and I'm just going to call this Unity Project. So with this folder selected, we're going to do Select Folder. And now I'm going to go ahead and actually import some of these initial packages that Unity has. So I'm going to use Character Controller, and I'll go ahead and bring in scripts right now. I don't necessarily have to, this is way later in the course here. But, you know what, I'm just going to go ahead and bring those in right now. So let's go ahead and hit Create. Now, if create is not available, that's because you don't actually have a folder selected for your location. You can't put it right on the hard drive. And there are specific folders that you cannot create a Unity project in. So, for example, if you go to your hard drive and you select Windows, that's not going to allow you to actually select that folder. So you need to be able to select a folder and then hit Create. Now, this is going to say do you want to see any changes to this? I'm going to hit Don't Save, because I don't need to make any changes to that. Now we're going to have a reboot of Unity. It's going to compile and import our assets, and then we're going to be ready to go here. So let's close out this Welcome to Unity. And, by the way, this is a great place to go ahead and find some quick answers. If I don't cover something specific, if you have a specific question, Unity's got a great place to go. So there are people on the forums that are really willing to answer some questions for you, so go ahead and utilize that if you need to. Now, where we're at right now is we have nothing to go with right now. So let's go ahead and click on our Standard Assets, and just kind of expand that. And you'll see that we have character controllers and we have scripts here. So what we're going to do is we're going to spend some time to actually import our FBX files to get started with building our level here. So what I want to do is actually go ahead and show you a pipeline to keep things nice and clean as we go along. So what I want to do is right-click inside of my project view, and go to Create and Folder. Now I'm creating this folder called Meshes. Now, I could go ahead and create this folder right in my Standard Assets. And I'm going to do that for right now, but I don't actually want my Meshes folder in my Standard Assets, I just kind of want to keep these separate. And it's my own personal preference, you could put it wherever you like, but this is just my personal pipeline. So I'm going to actually drag this outside of that Standard Assets. So there's Standard Assets, and then we have Meshes. So what I'm going to do is right-click on my Meshes folder, and Import New Asset. And what I'm going to do is actually import all of these different objects here. So I have Floor One and these different ones. Now, the downside to importing assets like this is that I can only do one at a time. I can't hold down control and import that way. I can't hold down shift to import multiples at a time. So what I'm going to do is just go through and import these files. So I'm going to show you how to do one. And I'm going to hit Import, and it's going to bring that file right in here. Now, whenever you import a file like this, a 3D object, a mesh, it's also going to create a materials folder inside of that folder there. So here I have Floor One, Material Seven. Now, this material is going to be gray. There's nothing on it, it's waiting for me to actually put some textures on it. So we're going to get into that a little bit later. So I just want you to know that it's going to create that folder for you automatically. It's nothing to get upset about, or try to figure out what's going on here-- I didn't actually import that. So I have my meshes, and to keep things even more organized I'm actually going to go ahead and create another folder here. I'm going to create what's called a Floor Folder, because I have several floors that I'm going to choose from. I'm just trying to keep things nice and neat and organized. So if I right-click in Meshes, I can Create New Folder, and I'll call this Floors-- or Floor Objects if you want to do it that way. And let's go ahead and select that Floor Object and that Materials, and we're going to click and drag and go right over the top of our Floor Objects folder. So now those objects are now in Floor Objects. So let's go ahead and right-click on Floor Objects, and we're going to Import New Asset. And we have Floor Two, and we're going to hit Import there. Now what I'm going to do is I'm actually going to go ahead and pause the video and import just the floors. And then I'm going to come back and show you another way to import these and make it very, very quick. So what I've done is I've gone ahead and imported these just by using that right-click and Import New Asset. And I just did those one at a time. Now if you want to speed this along, what you could do is actually go to your browser, your operating system browser, and what you could do is actually take the imported file and drag it over to your project file. Now, what I'm doing here, probably not the best thing to do because this can get kind of dangerous. What this could do is cause a linking problem between Unity and the project files in there. So you do want to be careful with this. Now I've done this several times, and it's been pretty harmless so far. But I do want you to be cautious of this, because Unity does warn against using the operating system to do things like this. You definitely don't want to delete objects right out of your operating system. You just don't want to do that, because it's going to cause problems with your Project folder inside of Unity. So what you could do is-- in your operating system-- is you could go ahead and select multiples and drag those right in there. So just to show you one example, I don't have this floor curved right in here, so I'm just going to drag it from my Floors folder and copy it right over into my Unity Project. So let's close these out. Now you'll notice that it isn't inside of my Project folder here. It is there, but what I need to do is actually refresh this folder. So if I right-click and Refresh, now you'll see Floor Curve is there, and it's also gone ahead and created the Floor Curved Right material, so that is in there. Now those are two different ways of actually importing assets into your folder, or importing packages here. So what we're going to do is I'm going to go ahead and actually do this a couple more times, just so we got a good idea of how to import assets. So I have my Floor Objects in, so what I'm going to do now is go ahead and import some more of my meshes here so we can get started into creating our project. So I'm going to right-click on Meshes, and I want to create a new folder inside of Meshes. So I'm actually going to call this Wall Objects, and let's go ahead and import those assets into our Wall Objects. So let's right-click on it, Import New Asset, and let's go up to Meshes-- just one set here. And I'm going to go to Walls, and let's go ahead and import these. So I'm just going to do Wall_1, and we'll just go ahead and keep going here. Now again, you'll notice that a Materials folder has been created inside of Wall Objects. So there is a folder of materials inside of Floor Objects and Wall Objects. You could go ahead and combine those if you want into their own folder, I've done that and it's worked OK. But to keeps things nice and simple, to keep my materials together and my meshes together, it's probably the best way to go about this. So what I'm going to do is go ahead and import the rest of my files for my project, and then we'll go ahead and we'll get started here. So I've brought in all of the assets that were in my Audio folder, that were in my Meshes folder, and then any sub-folders that were in there. And then my 2D textures, I've brought all of those in as well. Now I do want to show you one more thing right now. I want to show you a way of bringing in some objects, or some assets, really, really quickly. So let's say, for example, I want to bring in my Animations folder and I have those files there. What I can do is actually, with this open, I can go ahead and just drag this folder right into my product view, and it's going to go ahead and create that for me. So it's already formatted and everything. Now, I haven't had any issues with this. Again, Unity does warn against using the OS to import assets, and definitely against deleting assets. And I've found that the reason that is is because whenever you delete an asset right out of the operating system, what that's going to do is just completely delete it. If you delete it while in Unity, it's going to give you a warning and ask you are you sure you want to delete this? Because it's going to be gone forever. So again, I really haven't had that many problems, but there is a warning there. So if you want to go ahead and import those one at a time, be my guest and go ahead and do that. So what we've done is we've gone ahead and we've imported our assets into our new project. And now what we're ready to do is go ahead and start bringing these objects into our scene, and learn about how we can actually move them around and transform them to start creating our level. So we'll do that in our next lesson.