x


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

more ▼

asked Mar 18 '12 at 06:41 AM

Durante gravatar image

Durante
36 19 22 26

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3465
x1363
x957
x297

asked: Mar 18 '12 at 06:41 AM

Seen: 430 times

Last Updated: Mar 19 '12 at 11:20 AM