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);
}
}
↧