I have an array of game objects and an array of bools, I’m trying to instantiate the game objects if the bool is true but it’s not working.
Here’s what I have so far…
public bool[] itemOwned;
public GameObject[] items;
int itemNumber = -1;
public void setUpGear(){
foreach (GameObject item in items){
itemNumber += 1;
if(itemOwned[itemNumber]){
//instantiate code here
}
else
{
break;
}
}
Can anyone help please?