public GameObject[] cubes;
cubes[h] = GameObject.FindGameObjectsWithTag("Cubes");
h = h+1;
How can I number each array like this and store it like this.
How do I make that array work?
public GameObject[] cubes;
cubes[h] = GameObject.FindGameObjectsWithTag("Cubes");
h = h+1;
How can I number each array like this and store it like this.
How do I make that array work?
That array has a single dimension, it is not multi-dimensional.
As for the rest of what you say… number each array? store it like what? Like the code that you already have?
None of this makes any sense.
What are you attempting to do? Maybe then we could help you write code that accomplishes that.
What you’re looking for is called a jagged array.
public GameObject[][] cubes;
cubes = new GameObject[numOfArrays][];
cubes[h] = GameObject.FindGameObjectsWithTag("Cubes");
h += 1;
Thanks I had to say this
private GameObject[][] cubes = new GameObject[100][];
You have to set the number? Is there a way to get infinite.
You can use a List<> instead.
using System.Collections.Generic;
List<GameObject[]> objs = new List<GameObject[]>();
objs.Add(GameObject.FindGameObjectsWithTag("Cubes"));