going_balls/Assets/Scripts/CameraController.cs
2025-02-15 14:29:00 +05:30

21 lines
410 B
C#

using UnityEngine;
public class CameraController : MonoBehaviour
{
public Transform ball;
public Vector3 offset;
public float Smoothness;
void Start()
{
}
// Update is called once per frame
private void FixedUpdate()
{
transform.position = Vector3.Lerp(transform.position, ball.position+offset,Smoothness);
transform.LookAt(ball);
}
}