Pertex wrote:... added a script "after switching on the object", where you set the brightness of the lightbulb?
I think this is where you're problem is, if I understand what you've said.
1. Switching an object on/off doesn't do anything in and of itself except change the code attribute for the object between "on" and "off," because that kind of a switch could have many different effects with different objects. In order for it to
do something different when it's on, you have to include that specifically.
2. Making something a lightsource does
not automatically create ANY link to the concept of it being on or off, and if you set something to be a lightsource in its starting options, it will already be lit when the game starts.
3. What you need to do is let the lightbulb
not be a
strong lightsource when the game starts, and instead include a script which runs when it is switched to on that
makes it a strong lightsource. You're looking for "set object brightness," as Pertex said.
4. Now this is important: notice the difference between a "weak" lightsource and a "strong" light source. In order for the player to be able to see the lightbulb itself when the room is dark, it will need to start out as a "weak" lightsource. That allows it to be seen in the dark, but won't illuminate the whole room, like a strong lightsource will.
Did I understand the problem right? By the way, people really enjoy a little access to your game, or even screenshots of your problem, which I believe is the most you can offer while using the WebEditor. It's just easier to understand the problem if they can look at it themselves. (I say "they" because I am actually NOT one of the experts here, I've just done a LOT of work with lightsources recently.)