I'm trying to make a menu system for use with an Xbox controller and I want to walk through a selection grid with the left joystick. Unfortunately since its an axis it goes through really fast and it is rather difficult to select a specific button. I would just make it so it doesn't cycle through when you try to leave the array, but some of my menus have 3 items and it makes it difficult to select the middle element. Any ideas? Here's a code snippit.
if(Input.GetAxis("Vertical")){
var something : float = Input.GetAxis("Vertical");
if(something>0&&menu==true){ if(selGridInt >0){ selGridInt --; } else if(selGridInt ==0){ selGridInt = 2; }
}
if(something<0&&menu==true){ if(selGridInt <2){ selGridInt ++; } else if(selGridInt ==2){ selGridInt = 0; }
}
}
as you can tell, it makes it difficult to select element 1.