Lighting/animation bug


I have hit some kind of bug when trying to run my game. I have successfully created animations to change the positioning of a light switch to show it is changed, as well as an animation that changes a light from 0 energy without diffuse to a light with x energy and diffuse enabled.

I have set up the switch with a near sensor and keyboard sensor, then connected through an and controller each of my lights and switches in the are are connected via action actuators. The action actuators are in pingpong mode to allow users to turn lights on and off continually, they all also run from start: 1 and end: 2 as all animations are done from change of state in frame one to frame 2.

Now here is where the bug is happening. The above process 100% works at first, then if I close blender and reopen it or do some changes in the file, the light animation no longer really works. In run time all of the switches still animate, and the very first light system I created has the lights turn on, but no other lights turn on.

Inspection of this shows that the frame 2 of the animation for all of the other lights has the correct values, energy = x and diffuse = on, however it is not displayed as if it is. I notice though, if I click the diffuse off then on again or I change the value of the energy from x to y back to x, that the animation works correctly until I start making changes elsewhere or close/reopen the file. I also notice that duplicating the frames in the dope sheet, or messing with them in anyway in the dope sheet yields the same temporary working result.

Does anybody have any idea what is causing this/how to fix this? It has to be some kind of bug I think.

are they spawning same light?

that does not work

you will need a unique light for each spawner (it’s a openGL thing?)

It is a unique light with a unique name/data name for all of them. It does not spawn any light, the light is already spawned. The animation just changes the energy to make it visible or not.

check this out, (I can add in a animation handler if you need help with that)


LightSwitch.blend (490 KB)

An interesting solution to adding and hiding lights, but I am still curious for a solution to my problem in case it occurs in the future with other animations I create.

More as to what will cause it to work sometimes, then not the others.

I suspect all lights have a initial key they are sharing, try clearing the actions on the lights?

(they all move to point 1?)


This is a .blend I just made up having similar problems. The animation for all things runs from frames 1 - 2.

It is supposed to start on frame 1 with all lights off, then activate the switch, it changes to frame 2 for the light animation and the switch animation. When starting from frame 1, you will see that the switch animation will successfully play, but the light will not. Then starting from frame two, we see the switch moves correctly AND the light works correctly for both sides.

I am confused by such inconsistency I am seeing in my testings!

lightswitchtest.blend (486 KB)

its a bug,

I noticed if I turn it to gsl, and flip spec and shadow on and off it fixed it,

it looks like you had a animations key on spec?

Ah yes, altering the spec was a misclick, the error is there with and without it for me.

Has anybody else had this issue? What other fixes have you guys found besides just messing with the settings on and off until it works again?

use my switch :smiley: