I have a level with 10 objects in it, each one with a tag from 0-9. I want these objects to enable themselves one at a time e.g. kill one enemy, the next one becomes active etc. Can i set all of my ships into an array using GameObject.FindObjectsWithTag?
FindGameObjectsWithTag returns an array of GameObjects, but if the objects you want to find have different tags (ship0, ship1, etc.) then FindGameObjectsWithTag will only find one game object at a time and your array will only have one item in it.
One approach would be to build your array manually. Something like the following:
private int shipCount;
void Start()
{
GameObject[] ships = new GameObject[shipCount];
for(int i = 0; i < shipCount; i++)
{
ships *= GameObject.FindWithTag("ship" + i);*