NovaCode

Basic Camera Follow

Oct 26th, 2025
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.33 KB | Source Code | 0 0
  1. using UnityEngine;
  2.  
  3. public class CameraFollow : MonoBehaviour
  4. {
  5.     public Transform target;
  6.     public float smoothSpeed = 10f;
  7.  
  8.     void LateUpdate()
  9.     {
  10.         transform.position = Vector3.Lerp(
  11.             transform.position,
  12.             target.position,
  13.             smoothSpeed * Time.deltaTime
  14.         );
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment