How to make a light disappear?

Hey all!

I have a problem making a flickering light. I wrote a script that randomly makes the lights become invisible for a short duration. The script is working, but the lights doesn’t become invisible.

(I checked that it isn’t my script’s issue through placing a new light in the scene (not connecting it to the script) and then unchecking the visibility in the outliner. But when I started the game engine, the light appeared…

Shouldn’t it remain unvisible?

(BTW. I am using GLSL shading.)

Help would be appreciated. :slight_smile:

Triggering visibility doesn’t work. Make the script change the light’s energy instead (from lamp settings).

OK, thx, gonna try it out.

Works, thx again! :slight_smile:

You can use animations in the energy of the light, or use the “energy” of lamps variable using python.