Mussle flash script file
hey guys I'm making a survival horror fps game and I'm trying to add muzzle flash script to my shotgun that emits the particle only when the left mouse key is pressed I've tired many scripts that people have put up on the forums for it but they all end up with compile errors when I copy and paste them in.
does anyone have a free muzzle flash script file that I can download for my project because I'm new to unity and have no idea how to 'drive' the script editor.
thanks
Don't write a comment as an answer. Use the comment function. Only when you want to write a solution to a question, use the answer function.
Clicking on Add Your Reply @Le Pampelmuse jumps me down to a text box with the word Answer too high to see. So to most that Answer function looks like a Reply function.
I know you're trying to keep the forum neat but it does need some improvements like changing that link to say Add Your Answer. Then maybe new users might look for the comment link ins$$anonymous$$d.
Answer by JedBeryll · May 28, 2016 at 10:46 AM
Make the particle system duration short (maybe equal to the lifetime). Turn off looping and turn off play on awake. Set emission to 0, add a burst: at time 0, particle count 1 if its sprite sheet, otherwise set it to whatever you want. Call Play() from the script whenever it is fired.