How to change the update frame count

How do I make my script update every 2 or more frames instead of every single frame ?

var min = 0.3;
var max = 9;

function FixedUpdate () {

light.intensity=Random.Range(min , max);

}

use update and have a variable that counts the calls since last update and if a given amount has passed do the action and reset the count

Thanks but it still doesn’t work :

var min = 0.3;
var max = 0.6;
private var frameCount = 0;

function Update () {

if (frameCount) = 10;
{
light.intensity = Random.Range(min , max);
Reset (frameCount);
}
}

Two things need fixing in that code. First, conditions need to be entirely enclosed in parentheses, and should not be immediately followed by a semicolon. Second, unless you have a function called “Reset”, the code won’t compile. You don’t need a function to set a value to zero, though:

function Update () { 

	if (frameCount = 10)
	{ 
		light.intensity = Random.Range(min , max); 
		frameCount = 0; 
	} 
}

Basing your rate of flickering on the frame rate will cause the light to flicker faster when the frame rate is higher, though, which will look weird when the frame rate changes. Instead, you can use a timer like this:

var min = 0.3; 
var max = 0.6;
private var nextFlicker; 

function Update () { 

	if (Time.time > nextFlicker)
	{
		light.intensity = Random.Range(min , max); 
		nextFlicker += 0.3;
	} 
}

Here, we change the intensity every 0.3 seconds.

Thanks a lot man ! really helped me out there !