In this lecture, you will learn how to add sprites to your game project and game objects to your scenes in Unity. Sprite are simply graphical assets that we include as resources in our game so that we can show stuff in the game world. A sprite can be a single image or frame, or it can be a set of frames so that we can use that sprite for an animation. Those sets of frames in a single sprite are regularly called sprite strips or sprite sheets. Game objects are actually entities that are included in our Unity scenes. These are the entities that will react to other things in our game world and so on. Let's go to Unity and take a look at how all this works. This is a new project that I've created and we'll build on the game in this project throughout the rest of this module. I will point out that this is brand new, except I've changed the name of the scene to Scene0. You'll notice down here in the console window that I have a warning and I can't actually see that warning, but if I click this button, I get a message that says that there's a Visual Studio Editor Package update available and I'm strongly encouraged to update. I'm going to do that so that I can show you how to do it. The way you do this is you go to the top menu bar and you select Window, Package Manager. It lists the packages in the project. As you can see, Visual Studio Editor, I can expand and it has a recommended package to install. I've just selected that and I update it and I wait until it's done updating and then I'm all set. I still have this caution down here and I can just clear the console window and that goes away. For those of you who are irritated by warnings, that's a way to get rid of that warning. Because I want to add a sprite, I'm going to come over here in the Assets folder. I'll right click and I'll see create folder and I'll add a folder called sprites. Now I want to add a sprite to my project and Unity supports a whole bunch of different formats like PNGs and JPEGs and so on for our graphical images. I tend to use PNGs all the time, so that's what I'm going to use. There are multiple ways I can get a sprite into my project. One way is to just use my operating system to copy the PNG into that sprites folder and then it will be part of my project. I'm going to show you another way we can do this. We can also just drag the PNG file from our File Explorer or Finder if you're on a Mac over into sprites like this and I'll expand this. As we can see, we've now added a teddy bear sprite to our project. Now remember, the project window contains all the assets, that's why we have an assets folder by default, contains all the assets for our game. We don't have a teddy bear in our scene yet, and I'll expand the scene in the hierarchy window to show that, we still only have a Main Camera game object in our scene. The way I'm going to turn this sprite into a game object is, I'll just drag the sprite over into the hierarchy window and now it's been added to the scene. I'm going to rename it because I like to name my game objects using Pascal case. Capitalizing each word, just like we did when we declared constants in our C-Sharp code. You'll also notice that there's an asterisk next to scene. That means that I have some unsaved changes in my scene. I'm going to save the scene. I'll just Control S to do that. Now the scene is saved. If I look over here in the scene I can't actually see the teddy bear because it's behind the camera so I'll double click it. Now I've zoomed in on the teddy bear. We'll find that that's really helpful when we want to do things like edit colliders, which we'll learn about later in the module. Also, because I have the game object selected, I can see the components that are attached by default to new game objects that are added to the scene. We have a Sprite Renderer, so we can render or draw the sprite that's associated with this game object and we have a Transform, which we'll talk about much more as we actually modify the state of the game objects in our scene. But I'll tell you right now, the Transform contains the position of the game object where it is in the scene, how it's rotated around the x, y, and z axes, and the scale of the game object. Now as you can see in the game view, this teddy bear is pretty small. One way I could change that is I could change the scale here in x and y. Changing it in z in a 2D game doesn't make any difference at all. But I could change the scale in x and y to fix this. That's really a bad idea for a number of reasons. First of all, if I scale up this sprite, it's going to get pixelated. It's not going to look as nice if I scale it out. We'll also discover later that once we have colliders attached to our game objects, scaling the sprite without scaling the collider can lead to some problems in our games. So my recommendation to you will be to make sure your sprites are the correct size so you don't scale those game objects. Scaling the game object isn't the approach I want to take here. Instead, I'm going to select my Main Camera and over here on the right, there's a size characteristic for the camera, and I'm going to just change this size from 5-3 and you should watch the game view to see that when I do that, the teddy bear gets larger. But it doesn't get pixelated. By changing the size of the camera, we're changing how much of the game world the camera actually can see and by making it smaller we're making it see less of the game world so it looks like the teddy bear is larger and that's just what we want. There's an important lesson here. The important lesson here is that you should make sure that before you generate any of the art for your project at all, that you know what dimensions you need all that art to be so that you can make sure your artist creates all your art in the appropriate dimensions for this game. The art assets I'm using here were generated awhile ago by an artist who is no longer available to me. They did a great job for the purpose they originally did these art assets, but they're a little too small for the games that I want to build in Unity. I need to change the camera size. But you should make sure that your art is the appropriate size before you start to having an artist generate a bunch of art for you. Speaking of art assets being the appropriate size, this is my teddy bear sprite that I've opened up in paint.net, which is a great free software app for generating or editing 2D assets. If we look down here on the right, you can see that my art asset is 32 by 32. You should always make sure that the width and the height of your art assets are powers of two. It doesn't have to always be square, it doesn't always have to be 32 by 32, you can have an art assets that's eight by 64 and so on but you want each dimension of your art asset to be a power of two and this is for graphics card efficiency. Graphics cards work best if the textures or sprites that we're giving them are dimensions that are powers of two. You should get into that habit of doing that. You might wonder why I'm giving you art assets like this that have transparency on the left and right or top and bottom and you'll wonder why I didn't crop it like a good artist would do, but I'm being a good game developer and making sure that the dimensions are powers of two. That's how we can get a sprite added to our Unity project and turn that sprite into a game object in our Unity scene. To recap, in this lecture you learned how to add sprites to your Unity game project and you learned how to add game objects to a Unity scene.