24 days ago

I want to talk about Unity's "Pixel Perfect Camera".

#unity #pixelperfectcamera #cinemachine #gamedev #devlog


When I decided to use it: I was already deciding which tools I was going to use in the game, regarding the camera, Cinemachine and Pixel Perfect Camera. Then I was testing the game and noticed a shaking whenever I moved the player, so I just thought, "Damn, I messed something up in the movement."

I tried messing with the code, nothing. I changed the gravity thinking there were small jumps, nothing. Desperation set in, changing physics, changing movement, smoothing here, smoothing there, and nothing. Then I thought, "What if it's not physics?" I started looking at the image, my first suspect was CINEMACHINE. I changed the damping a million times, nothing, it only got worse.

Then, I entered the game scene, gave small taps on the movement keys to see if it would shake. That's when I noticed something: whenever it moved, it fit perfectly with the pixels of the scene. Then I thought, what if the movement doesn't allow it to fit with the pixels of the scene? Since it moves 4 pixels per second, it was more obvious. Then I realized it was the "PIXEL PERFECT" that was trying to keep it fitted to the pixel grid, and every time the player moved in the game, it adjusted to the grid every frame, causing intense shaking.

Conclusion: Pixel Perfect fit the sprites perfectly to the pixel grid, but this created shaking because the player's physics didn't do that. A conflict between smoothing and fitting. Solution: disable Pixel Perfect in the game.



1 comment

Loading...

Next up

The first reason for hatred that we will find in the game. #pixelart #platformergame #unity #2dgame #gamedev #indiegame

A short gameplay gif of the last level created for the game, 1-4: Jump Higher. #pixelart #indiegame #gamedev #unity #platformergame

Doki Doki Literature Club is celebrating Monika's birthday and the 8th anniversary of DDLC with exclusive stickers, avatar frames and backgrounds on Game Jolt! 

Head over to the shop to collect yours 👉 https://gamejolt.com/#shop

GIF of the new in-game skill that has been taking up a lot of my time. Read the article...

Mae Borowski is the main character of Night in the Woods! It's an adventure game that tells the story of her return to her hometown of Possum Springs. She was confirmed as canonically pan in a social media post by the game's creator Scott Benson.

The Needle #GJAsks

Random artwork: "Molli Pop" from Candies n Curse - One of my favorite games, I spent hours playing and replaying it. (I wanted to improve somehow, but I don't know how.) #pixelart #art #candiesncurse #mollipop

The Knightling launches on August 28! Wishlist it now so you don't miss out: https://bit.ly/KnightlingSteam

To celebrate the game's impending release, we've added The Knightling Pack and The Knightling Community Pack back to the Shop!

This creature is so discreet that I completely forgot it existed. I think these animations are sufficient for the game. If you have any ideas, feel free to suggest them. #pixelart #gamedev #indiegame #platformergame