Vector3 interpolations not smooth at all for smooth camera movement

I am currently making an endless runner game and so I wrote a simple smooth camera follow script to follow the player as he quickly dashes through the level. But instead of the camera smoothly following the player, it instead jitters and shakes. I mean it does smoothly follow the player, but once it’s close to the player, the camera starts to jitter and shake. I checked to see what exactly happens in it’s transform and I saw that the camera continually changes its rotation in the x axis and this hence causes the weird camera jittering and shaking problem but I have no idea how to fix it. In this scrip, I used the Vector3.smoothDamp function in order to interpolate smoothly from the camera’s position to the desired position however it still jitters and shakes. I also tried using Vector3.lerp and Vector3.slerp and it still jitters and shakes And I also tried using the LateUpdate and FixedUpdate function but the jittering motion still persists. Can someone please help me solve this problem.
Thanks in advance…

Use (test it both on the Update() function and in FixedUpdate() and see which works better)

Vector3.lerp(position, targetposition, MoveSpeed * Time.DeltaTime)

play around with the MoveSpeed variable, I find 3 works better for me.

The multiplication Time.DeltaTime in the end is needed so that unity will interpolate at the same rate as the framerate instead of jittering.

I tried what you asked me to do, I used the update function instead of the FixedUpdate function and I also used Vector3.Lerp instead of Vector3.SmoothDamp and nothing seemed to change, it still had that same jittery motion(I attached the script where I already made the changes on)
I then decided to analyse my player movement script, which basically moves the player very fast through the level.
I used the Update function to move the player very fast through the level(I included an image of the script), however if I put the logic(to move the player forward) into the LateUpdate function, instead of the Update function, and make the changes that you suggested, then the camera follows the player without jittering. But there could be jitter if I adjust the amoothAmount variable and increase it to anything above 10, but if I leave it at your suggested default of 3, then everything works
The problem comes in at the fact that the camera is also supposed to be offsetted to a particular position above the player(just to allow for more visibility) and I made a public Vector3 variable names offset in order to handle this(I simply add it to the player’s position in order to get the desiredPosition), but after I made all these changes, the offset variable no longer affects the camera’s position. I cranked the y offset all the way up to 10 000, however the camera’s position remains uneffected, but before I made the changes, the offset did Control the camera’s position. And the next problem I encountered was that when the player moves to the left or right, then the camera looks off to the side then interpolates it rotation to face the player again, instead of just moving left and right with the player, like how all normal endless game’s cameras work. But instead my camera looks of to the left or right and it moves by way too much, cause it is supposed to just look very slightly to the left when the player switches lanes. And the last problem that I encountered was that the camera cannot get beyond a certain point closer to the player or else it starts to jitter badly. Like the smoothAmount now controls how far the camera can get to the player and if I crank it up to like 12 it gets very close to the player and starts to jitter and if I increase the value more to let’s say 20 then the camera doesn’t get any closer but instead jitters more and more.
Sorry for the late reply, thanks so much for the help, I greatly appreciate it.

This is the CameraSmoothFollow script where I applied all the changes you suggested

This is the script I created to move the player very fast through the level, I suspect that this script may also be a contributory factor to the problem at hand


Sorry for doing it this way, I just can’t find way to add pictures to comments. Thank you so much for your generous help, I greatly appreciate it