- Home /
Flickering Light Help
Im making a flickering spotlight, i want the light to make a noise everytime it flickers, can anyone helps me, also i want the first person controller only be able to hear the sound when there within 15 ft of the spotlight If any one could help that would be nice. Heres my current script
var minFlickerSpeed : float = 0.01;
var maxFlickerSpeed : float = 0.1;
var minLightIntensity : float = 0;
var maxLightIntensity : float = 1;
while (true)
{
light.enabled = true;
light.intensity = Random.Range(minLightIntensity, maxLightIntensity);
yield WaitForSeconds (Random.Range(minFlickerSpeed, maxFlickerSpeed ));
light.enabled = false;
yield WaitForSeconds (Random.Range(minFlickerSpeed, maxFlickerSpeed ));
}
Comment
Look up how to do the sounds, try and implement it, then come back here :)
Your answer
Follow this Question
Related Questions
Lights only sometimes working 1 Answer
Shadow To Ignore Specific Objects? 1 Answer
Baked Lightmap + Dynamic Light 2 Answers
Spotlight switch script? 2 Answers
How to make flashing lights faster? 1 Answer