Turn light when door open

Hi guys
I make horror game, and i have a problem with one thing - i want something like this:
When i open door, light should be turn on, flicking few seconds and turn off, but i have no idea how to do it.
Any ideas? :>

As a starting point I would look at…
Create a script with a public light
Attach the script to the door
In the inspector attach the public light to the light in the scene
Within the script… On mouse click or collider (Depends on how you open the door) turn on the light and wait x seconds and turn off.

It doesn’t even need to be that complicated, another thing you could potentially do is keyframe in the light animation that you want, play it and then deactivate the light once the animation is over. To keyframe the light all you’d need to do is go to the animation window and animate the alpha transparency of your light to get the effect your looking for.

1 Like

I definitely prefer this approach to something like a coroutine or similar.