Create a point light or a spotlight
Create a javascript and put this script:
var lights : Light;
var tiem : float;
var tiems : float[];
function Start(){
lights = GetComponent.<Light>();
}
function Update(){
tiem -= Time.deltaTime;
if(tiem <= 0){
if(lights.enabled == true){
tiem = Random.Range(0.1, tiems[0]); //off
lights.enabled = false;
}else{
tiem = Random.Range(0.1, tiems[1]); //on
lights.enabled = true;
}
}
}
Asign the script to your light
Set the variables like the image
In 'tiems', the element 0 is the maxime time that will happen off, the element 1 is the maxime time that will happen on.
Any doubts, do not forget to comment, and recommend n_n
No comments:
Post a Comment