In this video, Jesse Freeman teaches you how to import sprites into Unity. You'll learn how to create a new 2D project in Unity, set up the folder you'll need to work in and copy over the artwork required to build your game. Working with artwork such as sprites in Unity 5 in an important skill for building a 2D game.
- [Voiceover] Before we start building out our game, we're gonna have to create the new game project. Here I have Unity opened up. And you'll see in this window if we actually had projects we had worked on in the past they would be listed out here under the projects tab. We're gonna create a new project, and we're gonna call this SuperZombieRunner. Our game is gonna be an endless runner, and these are very popular games and they're also easy to make. In this course, we're gonna focus on the essentials of what makes an endless runner.
Such as our player spawning objects and trying to avoid them so that we don't die. Once you selected a location for where you wanna save your project, make sure you select the 2D mode, so that Unity knows how to one, import artwork, and to convert them automatically into sprites instead of textures for us. And two, it'll also fix the way that the camera view is, so that we'll just see the 2D mode view. When you're ready, click create project. And Unity will create this new project for us.
Before we get into bringing in the artwork and the stuff we'll need for our game. I just wanted to take a moment to talk about configuring the layout of Unity. By default, this is what you see. Now usually I like to have the game tab below the scene. I move the hierarchy next to the inspector. And I'll put the project and console together at the bottom. And also, let me move the inspector closer to hierarchy, so I now have this panel split between the hierarchy, which will be everything inside of our game.
The inspector, which displays all the properties of any of the game objects in our scene that we select. The console is where we'll use for debugging, to trace out issues and values that we see inside of our game. And project is where all of our files are. Here in the scene view we'll be working with all the game objects and laying out our game. And in the game we'll be able to preview what we're doing and we'll also be able to see how the game is running when we hit the play button. When you're happy with a layout that you feel comfortable with, you can always go to the layout tab and save that layout.
Here, I've already saved out my own layout for scene game stacked, I'll rerun it, and you'll see it's similar to what we just laid out except this is more in the middle. Before we move on, let's add the artwork that we'll need in our game. Here in the assets folder, we can create other folders, in order to better organize our files. Simply right click in the assets folder, and select folder from the create menu. Here we'll call this artwork.
Now, I've already created all the artwork we need for the game, and I've actually organized them in folders for us. If we go into the artwork folder, that comes with the files we can select the three folders of artwork, and drag them over into our project into the artwork folder. You'll see here in Unity that we can now drop this down to see the files, as well as select them, and see the files here. If you'd like to see items in list view, you can drag the slider here, and now all the folders will be listed out.
This is convenient when you're going through and you have a lot of artwork that you need to go through, or other files such as scripts, and you wanna see a lot of them, and organize them a little bit better. Next, we'll talk about how to work with the artwork in our game. And we'll explain what a sprite is, and how to clean up the graphics, so that they're ready to use inside of our scene. Now we're ready to save our scene. If you hit command s, or go to file save, you'll be able to save the current scene we're working in.
Let's make sure that we save this inside of our assets folder, and let's make a folder called scenes. Now, inside of scenes we're gonna call this game staging, and for the rest of the project we'll be working inside of this scene. Normally, your game can contain multiple scenes, so I like to keep them organized in their own folder. Let's hit save, and you'll see that this shows up inside of our asset folder. If for any reason, when you relaunch the project, the default scene doesn't get loaded, you can simply go into the scenes folder, and double click on it to reload that scene.
It's also important to note, that when you're done making any changes to a project, you should always save the scene before quitting. Now, let's move on and take a look at how to work with sprites within our game.
Start watching to learn how to convert artwork into sprites, create repeating background textures with Unity's TexturePacker, and build reusable game objects such as players, obstacles, and enemies. Jesse also covers the basics of object pooling, working with custom UI components, and multiplatform publishing.
- Importing artwork
- Editing sprites
- Creating repeating background textures
- Building reusable obstacles
- Recycling game objects
- Building an object pool
- Creating the player
- Starting and ending the game
- Displaying and saving the score
- Adding menus and text
- Publishing a Unity game in different formats