I went through this tutorial because I wanted to learn how to make flashlights for guards patrolling an area in the dark. This one looked good for getting the base idea of creating one. Which afterwards, I realized just how easy it actually was, so I don’t have a lot of notes.
1:55 – After you create or download a flashlight model. Go to create, then under the light section choose a spotlight. And then position it to where it fits the place you would think the light would be going to from the flashlight. The light will likely look like it is too low, just increase the range, and then adjust the spot angle to the appropriate size. And mess with the intensity too if you don’t want a long range on the light. You could also change the light to a yellowish color if desired.
3:30 – Now, if you want the flashlight to activate by clicking the f key, for example. Click add new component, type, on off flashlight(whatever you want to name it), and select new script. Use an if else statement, if(Input.Getkeydown(Keycode.f)) I believe. Then if light.enabled == false, then light.enabled = true. Else light.enabled = false. This way the player just clicks the f key to enable/disable the flashlight.