using System.Collections; using System.Collections.Generic; using UnityEngine; public class CameraFollow : MonoBehaviour { private Vector3 tempPos; public GameObject Player; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { tempPos = transform.position; tempPos.x = Player.transform.position.x; tempPos.y = Player.transform.position.y; if(tempPos.y < 0) { tempPos.y = 0; } transform.position = tempPos; } }