- Home /
Question by
jimmyismike · Aug 27, 2011 at 01:24 PM ·
lighttogglespotlight
Light Toggle
How do I toggle a spotlight? I'd like it so I use the f key to do it.
Comment
Best Answer
Answer by Jorn · Aug 27, 2011 at 04:21 PM
An answer like that has been asked a lot on this forum. Try using the search bar a bit more.
Input.GetKeyDown(KeyCode.F){
gameObject.enabled = !gameObject.enabled;
}
Your answer
Follow this Question
Related Questions
Light Penetrating Fog 1 Answer
Weird bug with spotlight? 1 Answer
Flashlight battery script 3 Answers
all SpotLights on/off c#,Spotlight on/off C# 2 Answers
Toggling the light with lightmapping(baked and dynamic shadows) 1 Answer