Hey guys I am new to unity Pro. I have what seems to be a simple problem but I am not much of a programmer. I wanted the image effect to fade in when the player touches an object. Let the image effect stay for a minute or two, then fade out again
Any ideas please let me know!
I don’t know much about the Pro version, but I guess you’ll need to work with coroutines. Something like :
function Start()
{
yield FadeIn();
yield WaitForSeconds(120);
yield FadeOut();
}
function FadeIn(){
var alpha : float = 0.0;
while( alpha < 1.0 ){
// Do something with that alpha
alpha += Time.deltaTime;
yield null;
}
}
function FadeOut(){
var alpha : float = 1.0;
while( alpha > 0.0 ){
// Do something with that alpha
alpha -+= Time.deltaTime;
yield null;
}
}