UnityNinja Community
Would you like to react to this message? Create an account in a few clicks or log in to continue.

UnityNinja CommunityLog in

UnityNinja - Video Game Development Community, including Resources, Forums, Marketplace & More.


descriptionFlashLight Script  EmptyFlashLight Script

more_horiz
Assign to Empty GameObject that has a light on it

[You must be registered and logged in to see this link.]


Show Code :

descriptionFlashLight Script  EmptyRe: FlashLight Script

more_horiz
I think this is to much code.
You can just do light.enabled = !light.enabled;

Code:

function Update() {
if (Input.GetKeyDown("f")) {
      light.enabled = !light.enabled;
  }
}
privacy_tip Permissions in this forum:
You cannot reply to topics in this forum
power_settings_newLogin to reply