17 lines
349 B
C#
17 lines
349 B
C#
using UnityEngine;
|
|
|
|
public class CameraController : MonoBehaviour
|
|
{
|
|
public GameObject player;
|
|
private Vector3 _offset;
|
|
|
|
private void Start()
|
|
{
|
|
_offset = transform.position - player.transform.position;
|
|
}
|
|
|
|
private void LateUpdate()
|
|
{
|
|
transform.position = player.transform.position + _offset;
|
|
}
|
|
}
|