Too confused to start

Hi I really wanna make a 2d game and ive watched videos and read up on different things but theres one thing that confuses me more and more every time i read more about it and im hoping someone can either direct me to a noob friendly spot or noobafiy it for me.

How do i know was size and resolution to make my drawings to make it “pixel perfect.” wat exactly is pixel perfect ? xD and does it only apply to pixel art?

can someone also explain the whole pixel to unit ratio thing cuz i dont get it.

Thank you to every that decided to help me out even though this is basics to most, its driving me crazy.

When you import an image into Unity, say a 100x100 sprite, you get the option to set the Pixels Per Unit. It is exactly what it sounds like, “How many pixels does each Unity Unit represent?”.

By default it is 100.

What this means is that when you set your sprite gameobject position to x=1, the sprite will be 100 pixels to the right.

If you set that Pixels Per Unit to 1, then if you set your sprite to position x=1, then it will have only moved 1 pixel to the right.

Pixels Per Unit effectively determines the scale of your sprites in the engine, so that you can work in whatever Units you like.

For example, lots of pixel games are created using 32x32 tiles. Lots of developers set their Pixels Per Unit to 32, so that when they set a tile to position x=1, they know it will move a full tile width (32px) to the right. And if they set it to position x=10, then they know it will be 10 tile widths to the right.

Basically put: if you always want to be working with pixels as your units while working in Unity, use Pixels Per Unit of 1. Otherwise you can use your tile size.

If you’re using an Orthographic camera, then your sprites will always be full size because there is no depth/perspective to make them get smaller/larger on screen. The only thing that will make them NOT pixel perfect is if you move them to a sub-pixel position. So if you set your sprite to position x=2.3345, your art won’t look quite as nice on screen, because some pixels will be shifted one way or the other due to rounding.

Actually there’s a little bit more to pixel-perfection than that. You do in fact need to set your pixels per unit correctly (so that it goes evenly into the screen size), and you need to turn make a custom sprite material so you can turn on the PixelPerfect option (or something to that effect) in the sprite shader settings.

But all that is getting very pedantic, and as a beginner, I highly recommend you completely forget about it. It’s just not that important. And you have lots of more important (and fun) things to learn!

2 Likes

Personally I recommend leaving pixels-units at the default, not set to 1. There’s are reasons the default is 100, and the main reason is that the physics simulation can get flaky if your numbers are really big.

As for the size images appear, that’s about correctly setting the size of the camera. I explain it here on StackExchange: Why does Unity in 2d mode employ scaling and the default othographic size the way it does? - Game Development Stack Exchange

In particular, note this section:

3 Likes

This cleared up a lot. Thank you so much guys