unity camera follow player 3d smooth

Code Example - unity camera follow player 3d smooth

                
                        Vector3.SmoothDamp(cam.position, transform.position + cameraOffset, ref cameraVelocity, CameraFollowSmoothTime);
cam.position = cam.position + cameraVelocity * Time.deltaTime;
                    
                
 

camera follow player unity smooth

                        
                                // CAMERA FOLLOW PLAYER - IN FIXEDUPDATE

Vector3.SmoothDamp(cam.position, transform.position + cameraOffset, ref cameraVelocity, CameraFollowSmoothTime);
cam.position = cam.position + cameraVelocity * Time.deltaTime;