Object's instances stop spawning after i delete one of them


Hello!
I’m trying to make a game where you shoot enemies that spawn at random locations every 2 seconds. I’ve made so that when you shoot one instance, it gets deleted. But whenever i shoot one, all of them disappear, and they stop spawning. Can somebody tell me what’s wrong?

Thanks

Hi,
You are using a global variable instead of an object variable.