[SOLVED] Pixel Per Unit and Pixel Perfect Camera problem

Hello everyone!

I am creating a pixel perfect 2D game using the Pixel Perfect Camera package provided by Unity.
Unfortunately, I cannot understand how the Pixel Per Unit system works.

The Pixel Perfect Camera has this configuration:

The Camera has:

  • PPU = 32
  • Reference Resolution = 320x180
  • Pixel Snapping = true
  • Crop Frame: X = true, Y = true

Then, I have the Player’s sprite, which has a size of 32x32: so, I set its PPU to 32.

There is also the Level’s sprite, which has a size of 160x320: these numbers are a multiple of 32, so I set its PPU to 32 too.

With that said, I ask why I have this situation in my scene:

The Player’s sprite is not pixel perfect and the Level’s sprite size is smaller than its effective size.
If I have a reference resolution of 320x180, why the Level’s sprite (which has a size of 160x320) is contained in the scene? (320 > 180, its height would exceed and go outside the area visible by the player).
I want to understand the PPU system in order to set the best PPU as possible for the sprites of my game.

Thank you in advance!

Is the pixel perfect camera component attached to the camera?

1 Like

Thank you, I checked the camera and its Projection was set to Perspective, problem solved!