Hi folks,
I’m having a bit of a problem assigning tagged objects to an array and then hiding them. What I’ve currently got is;
var FstFloor : GameObject[];
FstFloor = GameObject.FindGameObjectsWithTag("firstfloor");
for (var i = 0; i < FstFloor.length; i++) {
FstFloor[i].GetComponent(MeshRenderer).enabled = false;
}
When the script runs, one of the tagged objects vanishes but none of the others. The error message comes up;
If anyone knows how to fix this I’d be thankful!
Cheers,
- Jon