Controlling lamps in the BGE with Python

Hey guys, I’m having trouble making changes to lamps in realtime in the game engine.

For example, I tried

lamp = scene.objects[“lamp”]
lamp.energy = 1

I’m having no luck, any suggestions?

Always check the System Console. A value of 1 won’t work because it’s an integer. Use 1.0 instead. You’ll see it works.

oh ok it works, thanks Raco!