I’ve searched quite a bit and I’ve tried all the solutions available, though I still haven’t found a working solution. When the target of a camera is a rigidbody(2D), there is always some jitter, as either the target (player) seems to jitter about, or the world around the player jitters about. It just seems that when the target of a camera has a rigidbody2D and it’s movement is from applying forces in FixedUpdate(), there is no way for the camera to smoothly follow the character without any jitter what so ever. Having the camera’s movement in Update(), LateUpdate() or FixedUpdate() doesn’t help, having it use a rigidbody2D along with interpolation on doesn’t help. I’ve tried all the combinations and nothing works right. Why is there no working solution for this out there? Did the developers behind Unity not think that a player would use a rigidbody2D with a camera following it?
Is there any working solution out there for this problem?
What I do is introduce a very slight delay by first of all finding the distance in x and y between the camera’s transform and the object’s transform, then instead of adding that distance to the camera’s transform, first scale it by a fixed number e.g. *0.5 or something, then add it to the camera’s transform. This way it will soften
and ease-in movements, and make the camera follow loosely with acceleration/decelleration which hopefully should smooth out most of the jitteriness you’re seeing… but it does mean the camera is slightly slower to catch up to the player’s position and so the player might go slightly off center? In the game I’m working on I’m using this to really smooth out the camera tracking of a 2d character and I allow it to be very loose so that camera movement is very gentle rather than sudden. If the player moves fast, the camera still catches up and he can’t get too far before the camera is up to speed
.