bledner 2.5x change light color

hey. i’m considering to make something bigger project… and i need for this ability to change the light color through python and the environment color too… thanks for replies :wink:

For the lamp’s color, use a Python script on the object that changes the color variable. For example,

from bge import logic

cont = logic.getCurrentController()
obj = cont.owner
obj.color = [r, g, b, a]

I think the alpha (a) is necessary. Anyway, run that script on the lamp and use whatever red, green, and blue values you want. If you want to change the energy of the lamp, use obj.energy. You should use print(dir(obj)) to learn what else a lamp can do - it’s very useful. For the environment color, I believe you can access the variable through bge.render.

yeah thanks i will try when i will be on my desktop :wink: this is very useful :slight_smile: