Here you have some misconcept in mind.
First I assume that you have assign this script to **finish line** , based on that my reply work for you.
You assign **FinishLine** script to FinishLine object so in **gameobject** you retrieve game object of finish line and you are destroying it rather than ball object.
Destroy(gameObject);
Instead of this you have to destroy ball object. That you do in following way.
Destroy(collision.gameObject);
I think there is no meaning of deactivating game object here. That you have done in this line.
other.gameObject.SetActive(false);
And in OnTriggerEnter() method you have used **other** as object but I can't find any reference of it in current context. So you have to look for it also.
↧