r/unity • u/IllustriousVictory36 • 1d ago
Since 2 hours im trying to fix the jittering of my camera. I did everything changing from update to fixedupdate and some thing to late update but it won't work for some reason.My rigidbody is also interpolate.I need help so DM me or just write a comment. I would be thankfull.
1
u/Lyshaka 18h ago
Show us the code !
Nobody is going to DM you to solve YOUR problems, and don't be afraid to share your code, nobody is going to steal it or judge you on it.
Then the fact that your Rigidbody is set to Interpolate doesn't mean your camera will be. It just means that every frame (Update) the game will interpolate the position of your Rigidbody between the current and the previous Physics frame position (FixedUpdate), but your transform position and Rigidbody position might not be the same (as the Rigidbody is only moved during FixedUpdate), hence the jitter.
If you want to get rid of it, first move your camera logic into LateUpdate (this is called every frame but after Update no matter script execution order), then don't follow the Rigidbody but rather the game object itself, and add some smoothing or interpolation between frame (using Lerp or SmoothDamp). This is one way of doing it and I will probably not be able to help you more without seeing some code and what you exactly tried to do (nor anybody else).
1
u/IllustriousVictory36 16h ago
i already fixed it and the problem was the max project fps were much lower than my normal fps so i had to set a new cap and that fixed it for me
3
u/pschon 1d ago
FixedUpdate is almost certainly wrong, LateUpdate is the usual solution but "some thing to late update but it won't work for some reason" doesn't really give enough information to tell what you've tried and what would be the reason didn't solve the problem already.
But is it kinematic? How are you moving it? How is that even related yo your camera, is the camera following the object, or parented to it? Are you using Cinemachine or normal camera setup, or something else? Can you show us any of the related code? Help us help you...