- Home /
Turn off multiple lights trigger
I'd really like to know how to turn off multiple lights at once in a scene by walking through a trigger. The lights selected here are the ones I'd like to be turned off with the trigger. Is there a way to do this? Thanks
Answer by AlucardJay · Apr 19, 2013 at 05:02 PM
Store all the lights in an array. When the trigger is entered, loop through every item in the array and disable the light component.
http://wiki.unity3d.com/index.php?title=Which_Kind_Of_Array_Or_Collection_Should_I_Use?
http://docs.unity3d.com/Documentation/ScriptReference/Light.html
http://docs.unity3d.com/Documentation/ScriptReference/Behaviour-enabled.html
http://docs.unity3d.com/Documentation/ScriptReference/Collider.OnTriggerEnter.html
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Script acces to a light its lightmode? 2 Answers
Turn on/off Script 3 Answers