Setting Pixels Per Unit to 1?

So I’ve been pondering over the best way to achieve pixel perfect movement and it hit me that I could just set pixels per unit to 1 and then round every position to nearest int. This has given me pixel perfect movement but why havent I seen this solution anywhere else? Is there any consequences to this method?

I’ve used this in my game and it works flawlessly, the only thing you need to keep in mind is to have all your sprites resolutions to be a power of 2 ( 64, 128, 256 etc). I’ve detailed this here.

Good luck.

1 Like

Awesome, thank you. Still weird I havent seen this solution suggested anywhere but hey.

There’s a discussion about it here every now and then. If you had concerns that it might be inadvisable because you didn’t find it suggested anywhere, rest easy.

The only thing that I’ve read causes negative side effects is using the physics system. The tiny colliders don’t always play nice with the standard physics config. There may be ways to fix issues using the Physics2D settings.

I’m doing this too, 1920x1080 is my coordinate system and display resolution, which makes it pretty simply to exactly position things. Using the sprite shader with pixel snap as well also helps to correct any issues of half pixel offsets between windows/mac and keeping things where they should be.