public GameObject ball; //assign the game object sphere or what ever you want to blink
public double timer;
public bool onoff;
void Update()
{
sphere_blink();
}
void sphere_blink()
{
if (Time.time > timer)
{
timer = Time.time + .4;
onoff = !onoff;
ball.renderer.enabled = onoff;
}//Time.time > timer ends
}//sphere_blink ends //in c# call the function sphere_blink() where ever you want the sphere to blink
var ball : GameObject ; //assign the game object sphere or what ever you want to blink
var timer : double ;
var onoff : boolean ;
function Update()
{
sphere_blink();
}
function sphere_blink()
{
if (Time.time > timer)
{
timer = Time.time + .4;
onoff = !onoff;
ball.renderer.enabled = onoff;
}//Time.time > timer ends
}//sphere_blink ends //in java script call the function sphere_blink() where ever you want the sphere to blink
This should work fine, as it is now it will change the color of the sphere every half second but you can adjust this by setting WaitTime to a different number
You have to access the Renderer component of your ball and change the color of the ball. Depending on what you want, you can change different kinds of colors.
There is the diffuse color (main color), which is the color that reacts on lights.
There is the ambient color, which is the color that doesn’t react at all, but simply lights the object.
And sometimes, there is the specular color, which is the highlight on your object.
In a script, you could make a timer. Whenever the timer goes off, change the color. Then reset the timer and let it count again.