To make a Flash light in Unity3D its rather simple all you need to do is reference a Light and set it enabled or not and to do this
all you need to do is use enabled = !enabled on a key press so if the light is on it will turn off and vice versa.
using UnityEngine;
[RequireComponent(typeof(Light))]
public class FlashLight : MonoBehaviour
{
public Light LightObject;
void Update()
{
if (NewInput.Instance.RawFire==1)
{
LightObject.enabled = !LightObject.enabled;
}
}
}