Hello! The camera is moving well when the character is walking. But when I stop you can see that the camera is trying to adjust the position, and it looks choppy. I’ve tried many possible fixes: have selected interpolation, tried choosing fixed/late update, and many other things. When damping is 0, there’s no such issue. How can I make damping smooth? The video is attached. Thank you in advance!
I suspect that the choppiness is coming from the PixelPerfect Camera component. It’s forcing the camera to be on pixel boundaries. When the camera is moving very slowly (for instance as it comes to a stop after damped movement) then its position will be rounded to the nearest pixel, because that is the job of the pixel perfect component.
Does the choppiness disappear if you remove the pixel perfect component? If so, are there alternate settings for that component that will allow the camera to be on sub-pixel boundaries?
Does the choppiness disappear if you remove the pixel-perfect component?
Yes, but now I see how backgrounds are trembling when I move.
If so, are there alternate settings for that component that will allow the camera to be on sub-pixel boundaries?
I tried tons of Pixel Perfect Camera settings, but it always behaves badly. I saw in several tutorials people advise using standard 320x180, but for me, 1920x1080 worked fine except for the damping issue mentioned above.
Okay, I removed the damping effect to check how it works. Now when I build the projects, and when I’m moving, everything around goes blurry except the character. I double-checked that Interpolate is selected in Rb, I’m using FixedUpdate and move character by changing velocity:
The background is trembling because the pixel-perfect pixels (I’ll call them the Big pixels) are not falling on the real pixel boundaries (let’s call them the Small pixels). The point of the PixelPerfect component is to make sure that the camera is positioned in such a way as to keep the boundaries of the Big pixels aligned with the boundaries of the Small pixels - that way nothing will shimmer.
So, Big pixels have to be an integral number of Small pixels in size. Once that condition is satisfied, then you should be able to position the camera anywhere on a Small pixel boundary and have a clean image. If your Small pixels are very small compared to the Big pixels, then you will get smoother movement when the camera is going slowly because the rounding only needs to be to the small pixel. So you want that ratio to be large.
None of this has anything to do with FixedUpdate vs LateUpdate. I suggest that you restore everything to the way it was in your earlier video.
Thank you for the reply!
If I understood you correctly, this ratio is shown below as the Current Pixel Ratio. But all my sprites have 32 PPU, so seems like this value should be correct, but it’s 2:1. When I change it to 64, it becomes 1:1. In both cases I don’t see trembling, but the image is still blurry on any movements (see attached video).
I’m not a pixel-perfect expert, so I can’t really advise you here. In your place, I would investigate how to increase that ratio. Maybe it means altering your sprites to use a bigger PPU. I don’t know. You might want to ask on the 2D forum: Unity Engine - Unity Discussions