- Home /
Question by
angrycarrots · Feb 15, 2013 at 04:20 AM ·
c#lightingenabled
How to turn off a light and change its intensity. Im new thanks!1
Hi i need help. I have a spotlight and im using it as a flashlight and I cant seem to turn it off when I press a button. Here is my code. Thanks!! (Also use c#)
` if(flashlightDead == false){
if(Input.GetKeyDown("f")){
if(lightOff == false){
lightOff = true;
light.intensity = flashlightOff;
}
if(lightOff == true){
lightOff = false;
light.intensity = flashlightOff;
}
}
}`
Comment
Your answer