all im trying to do is get the camera moving with the player and i keep getting the error on unity im not sure on how to fix it because im new to unity and iv tried looking at other questions similar to this and i cant figure it out
error CS0120: An object reference is required to access non-static member `UnityEngine.GameObject.transform’
// Use this for initialization
void Start () {
Player = GameObject.FindGameObjectWithTag("Player");
}
// Update is called once per frame
void lateUpdate () {
float x = Mathf.Clamp(Player.transform.position.x, xmin, xmax);
float y = Mathf.Clamp(Player.transform.position.y, ymin, ymax);
GameObject.transform.position = new Vector3 (x, y, GameObject.transform.position.z);
}
}