Timing problems.

Okay, so I am building a gun script from scratch. I am working on the part where the light flashes when you shoot, but for some reason, the light only shows on it’s will…

http://pastebin.com/ynfhcm1K

Like, the light will turn on at random times, but only when I’m supposed to be shooting… Is my stuff not supposed to be in lateUpdate?

I would think it should be Update.

I did that, with no avail.

have you looked at the fps tutorial codes? in there is a code about the muzzle flash. and on the wiki there is a code for a iron site like effect when aiming with a weapon.