Quantcast
Viewing all articles
Browse latest Browse all 6

Answer by An Item

void OnTriggerEnter(Collider collison) //your parameter name collision { if(other.gameObject.tag == "Ball") //but you call other instead { other.gameObject.SetActive(false); count += 1; SetCountText(); Debug.Log ("Score" + count); Destroy(gameObject); // do you need to destroy the finish line ? } } try this: void OnTriggerEnter(Collider other) { if(other.gameObject.tag == "Ball") { other.gameObject.SetActive(false); count += 1; SetCountText(); Debug.Log ("Score" + count); } }

Viewing all articles
Browse latest Browse all 6

Trending Articles