- Home /
Input wont work!!!
ok so i got my code to work correctly for the array but now the keys wont work IE they wont move up and down my menu which is supposed to "pop" the buttons out upon activating them so to speak with iTween. here is my script for the array
var MenuItems : menuItem[];
var currentMenuItem : int = 0;
function Update()
{
if(Input.GetAxisRaw("Vertical") > -5)
{
currentMenuItem--;
if(currentMenuItem < 0) currentMenuItem = 0;
}
else if (Input.GetAxisRaw("Vertical") < 1)
{
currentMenuItem++;
if(currentMenuItem >= MenuItems.length) currentMenuItem = MenuItems.length - 1;
}
}
ok now this code calls upon this one wich is attached to all my menu buttons.
/*function Start()
{
while (true)
{
OnSelected(true);
yield new WaitForSeconds(1.0);
OnSelected(false);
yield new WaitForSeconds(1.0);
}
}
*/
function OnSelected(on:boolean)
{
if (on)
{
iTween.MoveTo(gameObject,{"z":-1, "time":1});
}
else
{
iTween.MoveTo(gameObject,{"z":0, "time":1});
}
}
now the commented out code at the top of the second script is a test to make sure that the second script works and yes it does they all move while in infinite loop but when i attache the second code to them via the array when i press the up and down arrow keys nothing happens i have even tried to setup a If(Input.GetButtonDown("Fire1")) function and even when i do that it still dosent execute right can someone please help me.
Thank You
Your answer
Follow this Question
Related Questions
When using input, array.Add replaces the last member 1 Answer
Need help using GUI.Button/ input storage 1 Answer
User input display 1 Answer
displaying playerprefs 1 Answer
Error while trying to enter data to the array 2nd time. 0 Answers