using System.Collections; using System.Collections.Generic; using UnityEngine; public class MainCamera : MonoBehaviour { public GameObject Player; // Update is called once per frame void Update() { if (Player != null) { this.transform.position = new Vector3(this.Player.transform.position.x, this.Player.transform.position.y, -10f); } } }