#How to set a boolean arrays elements to equal a bool in a GameObjects array

1 messages · Page 1 of 1 (latest)

torpid lynx
#

I am trying to set a boolean array by accessing an equal part of another Gameobject array which works but the problem is that the GameObject array auto populates the array but the player states will not and it makes me auto increase the length in the inspector does anybody know why?
https://gdl.space/ayimulagor.cpp

jaunty nymph
#

i think you're not calling the function Players()

torpid lynx
#

I just realized that but it doesn't fix the problem no,
also tried this
public void Players()
{
bool state;
for(int i = 0; i < playerCount; i++)
{
state = players[i].GetComponent<PlayerController>().isDead;
playerStates.Append(state);
}
}

but it did not work either

jaunty nymph
#

does the object player have the tag Player?