3 hours 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.



0 comments

Loading...

Next up

I still have a few more behind-the-scenes moments I'd like to show, this time something much older. There's still one more page to show, but compromising things are there; let's wait until they're revealed. #indiegame #gamedev #devlog #sketches

It's not very visible, but this is a new animation of our hot-headed, or ELECTRIFYING, member. Can you guess what he does? #indiegame #pixelart #gamedev

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

It's been a week since I joined GameJolt with CloudPostman, so I decided to show you just a little bit of what goes on behind the scenes. #indiegame #gamedev #unity #pixelart #platformergame

Play @pm-studios ' Bandit Trap Open Beta!

Grab your rocket chairs, vacuums, and toilet tornadoes! Report one more time for our final beta! Live through March 23rd 6 am CET.

Complete quests based on the game!

Play the beta: https://bit.ly/BanditTrapBeta

Consistency in the color palette, Postman ready for delivery. Run, jump, flee, oh and fall. #indiegame #gamedev #pixelart #platformergame #indie

Going to work: running animation #gamedev #indie #indiedev #pixelart #platformergame

BIG NEWS: Your Bandit can wear a Game Jolt hat and shirt in Bandit Trap!

Defend your home or steal treasure in the open beta: https://bit.ly/BanditTrapBeta

It ends on March 23rd at 6 am CET!

I want your opinion: I made this cover scene, and I'd like to know what you think. I wanted to keep it simple, but it feels very empty and bland. #indiegame #gamdev #devlog #pixelart