21 lines
410 B
C#
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);
|
|
|
|
}
|
|
}
|