- Home /
Question by
mavii_ege · Feb 05, 2014 at 07:42 AM ·
lightflashlight
Flash light off on start
Hi i get my flashlight script working but when i debug/run the game its starts on i want it to be closed at first how do i do that Script #pragma strict
function Update ()
{
if (Input.GetKeyDown(KeyCode.F))
{
if(light.enabled == false)
{
light.enabled = true;
}
else
{
light.enabled = false;
}
}
}
Comment
Best Answer
Answer by getyour411 · Feb 05, 2014 at 07:42 AM
function Start() {
light.enabled = false;
}
Please review https://docs.unity3d.com/Documentation/Manual/ExecutionOrder.html
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
How do i put lights with muzzleflash? 1 Answer
Flashlight battery script 3 Answers
Very simple picking up items script? 2 Answers
How to stop rendering light? 1 Answer