|
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).
Thanks!.
(comments are locked)
|
|
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! Can I at least get a +1 for effort? ( :
Apr 06 '11 at 04:21 PM
AVividLight
I'm trying to get to 1K...
Apr 06 '11 at 04:22 PM
AVividLight
It's unseemly to beg for points. :-) p.s. +10
Apr 06 '11 at 06:03 PM
Bampf
LoL... I know, but 1K is so much cooler than 995...
Apr 06 '11 at 06:18 PM
AVividLight
This is going to be annoying, but I sorted it myself. Just switched round the order of everything - I had my {} wrong. Anyway, I'll give you a tick because you tried hard! and I may end up using one of your examples.
Apr 06 '11 at 07:21 PM
Muzz 1
(comments are locked)
|
Please note that the above code is untested and may contain errors. Doesn't work, sorry.
Apr 06 '11 at 03:56 PM
Muzz 1
Is it giving you any errors? Make sure you have a collider tagged Bottom and that collision is actually occurring. You also need to have a variable named fireworks that contains a reference to a gameObject or prefab in order for this to work.
Apr 06 '11 at 04:15 PM
e.bonneville
(comments are locked)
|
