Create and use Sprites (2D)

 

 Welcome to our Unity tutorial series.

Previously, Gamemakerlab was guide how to create project and Unity interface. Have you done it? We hope that all of us have done. In the other hand, you could review previous part through at link: http://gamemakerlab.com/unity/create-unity-project-interface .

Today, we’ll show you how to import your images into Unity and use it as sprites. It’s important to know this if you already had images of characters, enemies or whatever and just want to add them into Unity to complete your idea about your game.

 We’ll use this image as an example

Please notice: Unless your sprite is going to be used as a background, you have to make it transparent. This means your image does not have anything as background and its extension is “.png”.

This is the result when your image is transparent (on the right) and not transparent (on the left)

 If you’ve already set things up, let’s get started!

Open your Unity, create new project then look at Project window. If you don’t see it, press Ctrl + 5 (on windows) or select Window on menu bar -> Select Project.

 In this window, right click on Assets -> Create -> Folder

Name it as Sprites -> Enter

This step is not necessary but it’s good for you to arrange your project better.

Open Sprites folder, right click inside it -> Import New Asset…

Select the image you need to import -> Click Import

Now your image is already inside your Unity project, but it’s not a sprite yet.

To make it become sprite, click on it then look at Inspector window to see its properties:

Change two properties that I marked a red rectangle at above like this:

 

Click Apply to finish.

Notice: Change Format from Compressed to Truecolor means you don’t want Unity to decrease your image size because it could make the quality of your picture lower.

That’s all we need to do to create a simple sprite, now let’s add it to your current scene.

You can do easily by using drag and drop.

You can drag it (the sprite you just created) into Hierarchy window or into Scene window, Unity will automatically add it to another one.

This is the result in Scene and Game windows.

The last thing I think you should do is save your scene.

Press Ctrl + S (on windows), a dialog will show up.

Its current location is Assets, create new folder and name it as Scenes

Type your scene’s name then click Save or Enter.

Done! Now, we guess you can create and use a simple sprite for your own game, but if you still have any trouble or question, just leave a comment below.

Thanks for reading.

In the next time , we will show you how to make an object move. See you!