Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to prevent character shakiness when using Universal Render Pipeline Pixel Perfect Camera?

Discussion in '2D' started by Birdy-Bird, Dec 9, 2021.

  1. Birdy-Bird

    Birdy-Bird

    Joined:
    Apr 18, 2021
    Posts:
    20
    My setup

    - Cinemachine Brain on MainCamera

    - Cinemachine Virtual Camera (with Cinemachine Pixel Perfect component) following player
    • Body: Framing Transposer with .4 X & Y dampening
    - Pixel Perfect Camera
    • 32 PPU

    • 384 x 224 reference resolution

    • Pixel Snapping enabled
    - Player object is a RigidBody2D and is moved by applying velocity to it with W, A, S, D


    The shakiness is 100% caused by enabling pixel snapping, but my world sprites get really wonky and blurry when it’s turned off. It seems like I have a choice between a shaky character or glitchy world art. Has anyone figured this problem out?

    Video: https://imgur.com/a/ZmBxGoQ
     
  2. rarac

    rarac

    Joined:
    Feb 14, 2021
    Posts:
    570
    the problem is the damping effects on your camera, you have to choose if you want a super smooth camera or pixel perfect because those are mutually exclusive
     
  3. Rocky_Unity

    Rocky_Unity

    Joined:
    Oct 13, 2017
    Posts:
    96
    This is a common challenge with pixel art. The character jitter is coming as the camera moves one pixel ahead of the character, and the character sometimes will skip ahead 2 pixels, or no pixels.

    If you want a smooth camera motion with mostly pixel perfect graphics, you can try snapping any/ all of your sprites to a position that is in an increment of 1/ppu

    Also change your grid snap settings to 1/ppu

    I haven't really found the best solution for this yet either though