How do I make a light switch to turn lights on via collision

I am trying to make a button that shows the lights of a room and then switches them off by the player object simply touching another object. Basically I’m trying to create a light switch that is activated and switched off by the player simply walking into it. But its not doing that.

I have been using collision conditions and hide and show conditions to try and add the feature but when I test the feature out nothing happens. I know that I am doing something wrong but what exactly?

I have searched on the forum and I have found light based stuff but only things based around button based things, I can’t seem to apply this to collision based ways of setting it off.

sorry if this seems pretty easy for most, I have spent 2 days trying to figure it out alone but to no avail so any help is welcome.


You have the collision events as subevents of a “Beginning of scene” event. They only get processed once, when the game starts up.

However, when you move the events out the first event, the turning lamp on and off still won’t work. Add a boolean variable named “IsVisible” to the mainlamp_indoor object, and use the following events to toggle the lights one and off:

1 Like

Ah yes it makes sense now, I did think it needed to be checking for if it was hidden but I couldn’t figure out how at the time but the variable does make sense as I had to do so for my day and night cycle. This was really helpful thanks and will now be applying this to multiple rooms in the game.