Hi, I'm back. This time, I was wondering how to iterate through and delete gameObjects using JS. I'm using an invisible sphere as a target for a LookAt function. It's created when the user clicks. I'll not bore you with the details, but basically, I need to iterate through a list of gameObjects tagged "Target", and delete them. This is because every time I click, it creates a new target. When a unit gets there, the target is destroyed. However, if I click twice, the unit ignores the old target and goes to the new one. This means that there is a target the unit doesn't get to, and therefor isn't destroyed. After several minutes of gameplay, there are empty targets all over the place. This isn't good, and I sought to iterate through them and delete them one by one. However, I'm not sure how to do this. I tried several different codes cobbled together from a bunch of different sources, and spent a long time trying to get it to work. Not being successful, I decided to pick the brains of the gurus, and so posted my question here again. Unfortunately, I can't upvote an answer more than once, but I'm hoping even 10 rep is an incentive to answer... Thanks in advance!
Elliot Bonneville.