public void OnTriggerExit(Collider other) { if (other.CompareTag(correctTag)) { CheckBarrelPosition = GameObject.Find("MiniGameMain").GetComponent <MiniGameMain>(); if (correctTag == "Barrel") { CheckBarrelPosition.Barrel = false; } } }
public void OnTriggerEnter(Collider other) { if (other.CompareTag(correctTag)) { //Debug.Log(correctTag +" is correct"); CheckBarrelPosition = GameObject.Find("MiniGameMain").GetComponent <MiniGameMain>(); if (correctTag == "Barrel") { CheckBarrelPosition.Barrel = true; BarrelItem.transform.position = new Vector3(8, 0, 48); StartCoroutine(BlinkText()); } } else { //Debug.Log("An item is in the wrong place"); } }