Waitforseconds is skipping over

I have a function for a timer using waitforseconds but instead of waiting for how long I want to, it just skips it.

A ui text should become "foo" then 5 seconds later become "bar" but it turns to bar as soon as it starts.

Code:

void Update () {
text1.text = "foo";
wait (5);
text1.text = "bar";
}

IEnumerator wait(int time)
{
yield return new WaitForSeconds(time);
}

• I don't know syntax off top of my head, but throw the "bar" line into the Wait method after the wait line – Evorlor Jul 27 '15 at 20:58

void Start()