Files
ColorBall/Assets/Scripts/CameraController.cs

20 lines
383 B
C#
Raw Normal View History

2022-07-15 14:31:37 +02:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraController : MonoBehaviour
{
public GameObject player;
private Vector3 offset;
void Start()
{
offset = transform.position - player.transform.position;
}
void LateUpdate()
{
transform.position = player.transform.position + offset;
}
}