The game i am working on is about spawning ramps in front of cars. i have a simple spawning script that works fine. but i want to restrict the amount of clones i can make, was wondering how. THanks.
asked Aug 20 '11 at 06:26 AM
This how I recently solved this problem:
Where the var 'MaxObjectCount' adds one each time my Prefab spawns in the Update function, and in my 'checkhit' function I set it to destroy the first one I spawned after a set limit. So I can only have 15 clones at a time.
I'm fairly new and don't know if this is the best approach, but it works. I am now working on allowing the MaxObjectCount var to speak to the prefab so I can also keep track of the info to be able to do the same when I destroy my prefab via a collision.
I hope this helped.
answered Aug 23 '11 at 12:56 AM