Firing too many lasers. How to destroy objects.

Our last article set up our Player to fire lasers, and it looked pretty good. But I want you to have a look at something in the Hierarchy window while we are firing.

Our lasers are just piling up in the hierarchy, which means they are not disappearing. What we need to do is destroy them when they go off-screen. Luckily there is a method for this called Destroy. We can use an “if”…