Freebie: "Position toggle 1.0" (e.g., for turning lights on and off)

I've added a new free script to the Marketplace:


Quite a few people have asked if it's possible to turn lights on and off. I made this script as an answer to that request. You can't currently script lights' properties or make them appear and disappear. However, you can embed light sources in other objects. Since those objects can be dynamic and move, your lights can move with them. So turning on and off a light is as simple as instantly moving it into and out of the target portion of your scene. Maybe drop your light down 1 km below the floor.

This can also be used for crude door mechanisms, but the instant action would be disorienting and not pleasant. However, this could also be used to move other props between two positions and orientations (directions).

One little feature I added is a timeout. This is like how motion sensor lights work, where when you leave the room, the lights turn off after a while.


Please sign in to leave a comment.