adding a Wait command in my Input.GetAxis

so ive been trying to get a menu working with Input.GetAxis but having issues. after a few hours research i saw i needed to add a wait command of sorts, but you cant put them in Function Update. why is this not working.

var selGridInt : int = 0;    

var selStrings : String[] = ["Grid 1", "Grid 2", "Grid 3", "Grid 4"];

private var maxButton : int;    

function Wait(){

 yield WaitForSeconds(1);
 
 }

function Start()
{
    maxButton = selStrings.Length;    
}

function Update()
{
	Wait();

    if(Input.GetAxis("Joy1 Axis 2") < 0)
    	
    	
    {

        if(selGridInt > 0)
    
        {
            selGridInt--;
            
        }
        else
        {
            selGridInt = maxButton - 1;

           
        }                      
    }

    if(Input.GetAxis("Joy1 Axis 2") > 0)
    {
        // Create the same wrap around effect as above but alter for down arrow
        if(selGridInt < (maxButton-1))
        {
            selGridInt++;
        }
        else
        {
            selGridInt = 0;
        }                       
    }

The function Wait() becomes a coroutine with the inclusion of the ‘yield’ statement. You call Wait() in Update(). It executes down to the yield statement, and then it returns. It does not cause Update() to wait. You call this 30 - 100 times per second, so you are stacking up 30 to 100 Wait() coroutines before the first one finishes.

I’m not use why you want to wait. If you want a one-time wait there are a variety of ways to make it happen. One way would be to put this at the top of Update():

timer += Time.deltaTime;
if (timer < 1.0)
    return;

‘timer’ is a float you declare in the top of the file and initialize to 0.0. Here is a link to some material on coroutines:

http://unitygems.com/coroutines/