Hey people, i’m brazilian like my name ‘-’ and i don’t speak english so good but i need help.
I don’t know that name… i think that is ray light, that raylight in the begin the gun when shoot, i don’t know if you understand. If you don’t look that in google translator to portguese:
Olá pessoal, quero saber aquela luz
que fica no início da arma quando
atira, e preciso desse código em
maybe the name is gunfire
You just instantiate a light gameobject and destroy it after a fraction of a second. Alternatively, you can create it before game start, disable the light, store it in a variable so it can be accessed, and then when the gun fires, quickly enable and disable it.
A common way to achieve the desired effect is to combine the light with a muzzleflash model or particle system so the muzzleflash can be actualy seen instead of just lighting up the scenery.
There are a number of threads and tutorials for creating a muzzleflash.