void OnCollisionEnter (Collision other) { hitLight.intensity = 8; hit = true; } void Update () { if(hit) Flash(); } void Flash () { if (hitLight.intensity > 0) hitLight.intensity -= hitFlashFade*Time.deltaTime; else { hitLight.intensity = 0; hit = false; } }