I've tagged my Cannonball's prefab with 'CannonBall' and I made this function to delete them when they collide. I added it to the prefab as well. Problem is, they don't delete. Any mistake in my logic? I'm pretty new to Unity. Thanks!
You already have the reference to the object you want to destroy so there is no need to attept to find it.
Other than that, make sure that your cannon ball has a collider and that the tag of that colliders game object really is exactly "CannonBall".
If you would use GameObject.FindWithTag you might get "any" cannonball. Maybe not the one you collided with.
answered Dec 09 '10 at 01:08 AM