Using Else on OnTriggerStay, do a game over if i click when i dont have a box on it the collidor/mesh.
This is my current script, but i don't know how to do a "gameover" when the box isn't in the collidor, please help!
public GameObject Particula;
void OnTriggerStay (Collider other) {
if (Input.GetMouseButtonDown (0)) {
if (other.gameObject.tag == "box") {
Debug.Log ("win");
Instantiate (Particula, other.transform.position, Quaternion.identity);
Destroy (other.gameObject);
}
}
}
19478100-1336416809810043-494402988-n.png
(129.7 kB)
Comment