FragMate CommunityLog in

FragMate - Software and Game Developer Community, including Resources, Forums, Marketplace & More.

Share

descriptionSimple Flashlight script

more_horiz
to get this script to work just add a flashlight to the player and attach this script to it .... i know really simple but it works fine

Code:

var FlashSound : AudioClip;
var linkedLight : Light;

function Update () {
    if(Input.GetKeyDown("f")){
        linkedLight.enabled = !linkedLight.enabled;
        audio.PlayOneShot(FlashSound, 1.0 / audio.volume);
   }
}

function LightOff (){
   linkedLight.enabled = false;
   audio.PlayOneShot(FlashSound, 1.0 / audio.volume);
}   

descriptionRe: Simple Flashlight script

more_horiz
Thanks for sharing Very Happy 

descriptionRe: Simple Flashlight script

more_horiz
Thanks, needed this

descriptionRe: Simple Flashlight script

more_horiz
I am posting an ADVANCED flashlight script in about 30 minutes  Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy 

descriptionRe: Simple Flashlight script

more_horiz
Hey, is this for javascript? It looks like it, but just to be certain.

_________________
-One Knife Games
Permissions in this forum:
You cannot reply to topics in this forum