What determines Action Button display order?

My project displays Grenade action button first… the lecture video shows it as the last button. Any idea how to set the display order?

I’m thinking it would be a Sort of actionButtonUIList before the foreach below, but that doesn’t explain the difference in my project and the lecture…

private void UpdateSelectedVisual()
{
    foreach (ActionButtonUI actionButtonUI in actionButtonUIList)
    {
        actionButtonUI.UpdateSelectedVisual();
    }
}

Hi @michael_collett! Welcome to the community

I believe the order of the buttons are determined by the order the actions appear on the unit in the inspector

These are before and after I moved the grenade up in the inspector

2 Likes

Yup the order comes from calling GetComponents(); which goes through the Game Object and sequentially grabs them. You can right click on a component to push it up/down

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms