In the picture below you can see I’ve got a destructible mesh tied into a set amount of health. Everything I have done so far is in perfect working order except for ONE thing. So I’ll explain what I want to do and go from there.
I want to destroy an object and have it spawn another one when it gets blown up. This works perfectly except for one small problem. After I shoot the object, it spawns another one and continues the script. However, if I keep shooting the object, it keeps spawning more and more and more and more… . . U get the point.
So when the object blows up, and I shoot the debris from the object i JUST blew up, it will continue to spawn because the script thinks it keeps getting to 0 or below health. I don’t want this to happen.
If you look at the script, you can see that when the object gets to 0 or below health, it will continue the script. How would I get this to stop spawning more then ONE at a time? It’s like shooting an enemy AI, and only asking for one AI to spawn at the same time.
When the object I want to blow up gets to 0 or below health, how can I have the script spawn a set amount of objects? As it is right now, it keeps spawning until I stop shooting the object. Sorry, it’s kind of difficult to explain what I’m asking… Late night trying to figure this out.