Highlight/colour change of selected array gameObject help!

I’ve been using this code from the forum, can’t remember the source, and I’ve edited it from gui.buttons so I can use gameobjects instead, which are just guiText for my game menu. They are a specific font and size and It works so you can scroll through them on the keys and select with space bar, but you can not see which one is selected, was hoping of some way of highlighting or changing the colour of the current selected gameobject. Thank you for any help, I also hope I’ve given enough information and posted correctly :smile:

var menuItems : GameObject[];
var selectedIndex = 0;


function menuSelection (menuItems, selectedItem, direction) {

    if (direction == "up") {

          if (selectedItem == 0) {
            selectedItem = menuItems.length - 1;

        } else {
            selectedItem -= 1;
        }
    } 

    if (direction == "down") {

        if (selectedItem == menuItems.length - 1) {
            selectedItem = 0;

        } else {

            selectedItem += 1;
        }
    }
    return selectedItem;
}

function Update ()

{

    if (Input.GetKeyDown("down")) {
       selectedIndex = menuSelection(menuItems, selectedIndex, "down");

    }

    if (Input.GetKeyDown("up")) {
        selectedIndex = menuSelection(menuItems, selectedIndex, "up");

    }

    if (Input.GetKeyDown("space")) {    
        handleSelection();

    }
}

function handleSelection()

{
    switch (selectedIndex)

    {
        case 0:  
               Application.LoadLevel("Frontier");
               break;

        case 1: 
//                Application.LoadLevel("Options");
                break;

        case 2: 
//                Application.LoadLevel("About");
                break;

        case 3: 
                 Application.Quit();
                 break;          

        default:
               Debug.Log ("None of the above selected..");
               break;
    }
}

My assistance would be more effective if you provided the object placement code, but you could simply place a plane behind the selected object… getting the coordinates is dependant on how the items are aligned.

If you mean the code on the game objects, there isn’t any, The code above, I have played on an empty game object simply name MenuLabels. What I’ve been trying to do is use the controls on the xbox controller I have for the menu screen instead of a mouse. The closest I got is above, as I can change the keys and inputs easily. The only problem is some sort of visual feedback so the player can see what is the current selection. I hope that clears it up better