I'm already looking for this for hours now, but I can't figure it out.
A sphere needs to disappear after 3 seconds and then reappear, but I can't get the function for this to loop in the update without starting to flash. InvokeRepeating malfunctions too with the yield waitforseconds in there.
function update()
{
//So that function just needs to be refreshed here or something
Sphere();
}
I would use a variable to store the elapsed time since the last "disappear" and/or the last "respawn" of your sphere, I'm using something similar for a bridge which opens and closes at regular intervals... try something like this...
var myDelay : float = 3;
private var countTime : float = 0;
function Start() {
countTime = Time.time;
}
function Update() {
if ( (Time.time - countTime) >= myDelay) {
// Code to make the sphere render if not render, and to hide if rendered
countTime = Time.time;
}
}