If the gameObject is active move index place

I have 6 Items in a Empty object which holds my Weapon Select script, I can only have 2 objects at any one time due to another script I have elsewhere, I’m just wondering if there is any way I can move any Active objects to the top of the Index thus allowing them to be used by Alpha1 and Alpha2, But when they are switched I still want them to hold their same positions so, Let say I was to Disable 2 due to switching to Item 1, I wouldn’t want the disabled item moving back to its original index e.g. 5, And just a tiny related question, How do I set the active state of a child object Nothing I’m trying is working. Hope someone can help.

Sounds like it would be easier to just use two integers that you set to the active weapons, like int weaponIndex1 and int weaponIndex2, which then correspond with the weapon/item from your array. Then you don’t have to do anything with that array itself.

You can acces child objects with Transform.GetChild(int index), and then do something like Transform.Getchild(0).gameObject.SetActive(true)