Horror Flicker Light Generator for Unity and Godot
Pick a preset or move the sliders and watch the bulb. When it feels right, copy the script for Unity or Godot and attach it to a light.
Presets
Preview
using UnityEngine;
public class FlickerLight : MonoBehaviour
{
public float baseIntensity = 1.2;
public float flickerAmount = 0.25;
public float speed = 6;
public float dropoutsPerSecond = 0.2;
public float dropoutSeconds = 0.1;
Light lamp; float seed; float offUntil;
void Awake() { lamp = GetComponent<Light>(); seed = Random.value * 100f; }
void Update()
{
if (Time.time < offUntil) { lamp.intensity = 0f; return; }
if (Random.value < dropoutsPerSecond * Time.deltaTime) offUntil = Time.time + dropoutSeconds;
float n = Mathf.PerlinNoise(seed, Time.time * speed);
lamp.intensity = Mathf.Max(0f, baseIntensity + (n - 0.5f) * 2f * flickerAmount);
}
}How to use flicker well
Noise-based flicker feels organic, and rare dropouts make it feel faulty. Use few flickering lights and keep most lights steady, so the flicker means something.
Read the full guide: [horror lighting and flicker in Unity](/guides/horror-lighting-and-flicker-in-unity/).
When to use it
A broken corridor light
Use slow noise with rare dropouts so the player notices the light only when it dies for a second.
Signalling danger
Speed the flicker up when the monster is near; players learn to read the light as a warning.
Candles and fire
Low strength and fast noise without dropouts gives a warm, living flame instead of an electrical fault.
Go further
Questions
It follows the same logic, but noise differs slightly between Unity, Godot and the browser. Fine-tune in the engine.
Yes. It is generated from your settings and is yours to use.
Changing a light's intensity every frame is cheap. Shadows are what cost: keep flickering lights with real-time shadows to a few per room.
Fast, high-contrast flashing can be. Keep the frequency low, avoid full-screen flashes and offer an option to reduce flicker in the settings.


