I am currently working on a horror game and I have a fuse box and multiple lights, I need all the lights to be disabled when the game starts and then when the player clicks on the fuse box all the lights come on. Plz Help
1 Like
what code have you built so far for your game? what does your “interact with object” code look like?
This is the code I have for a light switch that will turn a single light on and off but I need multiple lights to turn on.
#pragma strict
var MyLight: Light;
var lightmanager=0;
function OnMouseDown (){
if(lightmanager==0){
MyLight.enabled = false;
lightmanager++;
return;
}
if(lightmanager==1){
MyLight.enabled = true;
lightmanager–;
}
}
instead of a single light add a list. Then iterate over the list turning them on/off