I am instantiating a bunch of projectiles that I want to destroy at certain intervals and thought I could do it with this script, but Unity is objecting about argument lists. Anyone know how I need to change this? Thanks.
objects = GameObject.FindGameObjectsWithTag("proj"); Destroy(objects);
Destroy() takes a single object; and what you’re passing is an array of them. Try something like this instead (not tested):
objects = GameObject.FindGameObjectsWithTag("proj"); for( var o in objects ) Destroy(o);
That did it. I didn’t realize “Destroy” was a single-object action. Good to have a solution to that! Thanks.