Hello,
I’ve been trying to find a way to link a light to a shuriken particle system. It’s going to be used for the light flash of an explosion and muzzle flashes and the like. Could you elaborate how I would be able to animate such a thing? I’m guessing with code or something, but maybe with the animation view. I couldn’t figure it out. could anyone help me? (the effects will be pre-fabs spawned in at the correct location)
Thanks!
Could just put a disabled spot/point light on the end of your gun. Then just turn it on and off when you shoot:
public GameObject myLight; // drag in the light
void shoot() {
myLight.active=true;
// spawn particles for flash, etc...
}
Then use a counter, or Time or a coroutine to set active=false after 2 frames (the same way you wait 1/2-sec to fire, also wait 1/20th sec to turn off the light.)
Thanks, I asked a programmer to help me with a bit of code to control the light with a lerp.