Gui Text Fade, not responding to WaitForSeconds?

It works in general, except the timer is not working, it is not responding to the delay, which should be like 1 second i think, but it takes over 10sec to fade out?
What am i missing here? And also it don’t shut off when a new one pops up.
So every time i hit a new “collider” it shows the new text fading on top on the previous one all jumbled up.

//var TextOne : GameObject;
//var TextTwo : GameObject;

function Start(){
//TextOne.SetActive (true);
guiText.material.color.a = 0;
yield WaitForSeconds(0.1);
function FadeIn(){
while (guiText.material.color.a < 2){
guiText.material.color.a += 0.1 * Time.deltaTime * 2;
yield WaitForSeconds(0.1);
//TextOne.SetActive (false);
//TextTwo.SetActive (true);

function FadeOut(){
while (guiText.material.color.a > 0){
guiText.material.color.a -= 0.1 * Time.deltaTime * 2;
Destroy (gameObject);

Hi, I use this for waiting seconds I had gotten it from the scripting reference worked for me in my project :slight_smile:

yield WaitForSeconds (5);

Here this link

Hope It helps :slight_smile: