← back to articles

How to set up Unity3D for a pixel art game! | Ludum Dare

Save article ToRead Archive Delete · Log out

2 min read · View original · ludumdare.com

This is a quick tutorial I’m putting together as a part of my warm up for Ludum Dare. Lots of people love Unity but sometimes things can take a while to do. This is one of those awkward things: pixel art.

Create a sprite

Grab your lovely pixel sprite texture and put it into a ‘Sprites’ folder in Unity. Click on the texture and set it up as follows:

Apply these settings. In 2D mode on the Unity Scene Editor, draw the sprite from the Project window to the scene. Follow the dialog for making an animation.

Unity 3D Pixel Art Tutorial

 

Create a sprite material

Create a new material in a ‘Materials’ folder. Set it up as follows:

Apply the material to your sprite by dragging it from the Project window to the sprite object in your scene.

Unity 3D Pixel Art Tutorial

 

Modify the camera

Select the ‘Main Camera’ in the Hierarchy and set the values of the ‘Camera Component’ to:

Unity 3D Pixel Art Tutorial

(in this case I was using a 24×24 size sprite and a screen height of 320 which gave me 6.66666, I wasn’t happy with that so I doubled it. I would recommend not using 24×24 size sprites.)

 

Preparing the game window

Select the Game window and click the drop down to choose the screen aspect ratio, usually ‘Free Aspect’. Click the plus button to add a new screen setup and then enter in the screen size you chose. Give it a name and click okay. Then select that screen size.

Unity 3D Pixel Art Tutorial

 

Preparing the build output

To setup the resolution for the built version of the game, go to Edit > Settings > Player Settings and then modify the following values for the platform you want to build to:

There may be other things you want to change such as ‘Default Full Screen’.

Unity 3D Pixel Art Tutorial

 

Try it out!

 

Let me know if any of that didn’t make sense. Good luck for the weekend!