I'm trying to activate the array object that have button component.
public GameObject[] weapon_carry_pistol = new GameObject[3];
public int p1_carry,activeObjects;
// Update is called once per frame
void Update()
{
p1_carry = weapon_carry_pistol[0].GetComponentsInChildren<Button>().Length; // 6 objects
for (int i = 0; i < activeObjects; i++)
{
weapon_carry_pistol[0].GetComponentsInChildren<Button>()[i].enabled = true;
}
}
This script do activate the button component but not the whole game object. If I change "Button" to "GameObject" I get error //.GetComponent requires that the requested component 'GameObject' derives from MonoBehaviour or Component or is an interface.//