Simply, how do you insantiate an object once when using a function OnCollisionEnter? So in this script, how would you only make it instantiate one firework? (By the way, the rest of the script works - I'm not missing the function or the variables, this is just the relevent part).
It would help to see the rest of your script, but, if you only want it to work ONCE and never again, you could do this:
If you want it to work every few seconds, you could do this:
If it is update, use this:
Just so you know, I haven't tried any of these codes... If you get any errors, let me know!
-- - Hope I Helped!
answered Apr 06 '11 at 04:16 PM
Please note that the above code is untested and may contain errors.
answered Apr 06 '11 at 02:27 PM