Smooth Camera Movement

Hi all,

I am making a racing game in which i am shifting the target of camera from one car to another.

If i am changing the target, the camera is suddenly coming on the back of another car to which the target have been shifted to.

What i want is that the camera has to travel in the path to reach the target instead going to the back of the new target suddenly.

I have been using this code to try that

cameraTransform.position = Vector3.Lerp(cameraTransform.position, TargetPosition, 5.0f * Time.deltaTime);

I suppose if use LateUpdate instead of Update it should be better!

Try increasing the 5.0f multiplier. What you got there is saying go from camera position to target position in 5 frames. At 24 frames a second, you will barely notice the 5 frames and it will seem more like a jerky motion, at an even higher frame rate it will be worse.