
It's the conversion factor between the texture resolution and the coordinate space of your gameplay logic.įor example, if you're making a tile-based game with 32x32 tiles, a PPU of 32 would make good sense. Generally you want to keep your Pixels per Unit setting constant for a set of assets you use together. Is there some concept I am not properly grasping about Units and Pixels? Since this setting is not automatic, and cannot be changed on runtime (I think), does this mean that I have to duplicate the same sprite and set every file with different PPU, depending on all the resolutions I want to support, and then in runtime select the appropiate sprite? Because that doesn't seem right. So in this case set the "Pixels per unit" to 108.īut then, if I want to allow to have different resolutions in my game, say 1440p, this means that the "Pixels per unit" for my sprite must be 144, instead of 108. Which means that I have to manually the calculation between the resolution of my display and the size of my camera. There is a field calles "pixels per unit". To do this, I would like to upscale it 4 times, meaning that instead of 35x37, I want to draw 140x148 pixels, right?īut if I go to the settings of my sprite, I find the following settings:

Since I want my game to be a pixel art, I want the pixels to be more prominent. Now, I have my sprite, a 35x37 pixels image. On the other hand, if I set the resolution of "Display 1" to 2560x1440, this would mean that every unit would draw 144 pixels, right?

If the height of the screen in pixels is 1080, and there are 10 units, this would mean that every unity will be 108 pixels, right? This means too that the total height of the camera are 10 units.Īt the same time we have a "Display 1" set to 1920x1080. This means that there are 5 units from the center of the camera to either the top or bottom border. I don't get how units and pixels work in Unity.
