float $fFreq = 15.0; float $fMinIntensity = 0.5; float $fMaxIntenxity = 1.0; float $fIntensity = $fMaxIntenxity * .5 * (1 + noise(time * $fFreq)); if($fIntensity > $fMinIntensity) pointLightShape1.intensity = $fIntensity; else pointLightShape1.intensity = 0.0;
The problem is that rand is evaluated per-frame, so it will of course create a flickering effect. As Kari has shown above, using the noise function will create a much smoother transition in-between frames.
$time = `currentTime -q`;
pointLightShape1.intensity = rand(#,#)* $time/$time;
go to the light intensity> right click > create new expression> paste into bottom field> click create.
when using this obviously you need to change the light type, and replace # with whatever you intensity values are going to be.