|
I am making a grenade and want a timer, so it doesn't explode as soon as it hits the ground. What script is used for this?
(comments are locked)
|
|
Take a look at WaitForSeconds. Then, assuming you want the timer to start from when the grenade is thrown, do something like:
In future, you should try scripting it yourself and then post if you have problems (that you can't find a solution for by searching). Otherwise you'll usually have your question tagged as 'write-my-code', and generally they're ignored.
(comments are locked)
|
|
Well i will be happy to right your code. But this may not work. But go ahead and try it.
If this does not work for you search up yeild wait for seconds but this should work. You have to code your own particle emiter though. So you got to do a bit coding yourself too you know.
(comments are locked)
|
|
Instantiate the grenade... Destroy(gameObject, 5); http://unity3d.com/support/documentation/ScriptReference/Object.Destroy.html Particle Effect the grenade... Your first answer was more correct. He wants the particle effects when the grenade is destroyed. If he does as you've said, the explosion will happen and then 5 seconds later the grenade will disappear.
Aug 25 '10 at 05:11 AM
Marowi
Yea, I looked at my first post and didn't think that was the correct way to do it... obv it was lol!
Aug 25 '10 at 11:50 PM
joedrigon
(comments are locked)
|
