I am new to Unity programming.
I’m trying to make a for loop collect 100 images in the void Start. But the script doesn’t work.
The images are imported as sprites and have a tag called “puntosVerdes” I also added a script called the same “puntosVerdes”. But I can’t find them even with the search by Tags or by “FindObjectOfType”. Could someone give me a hand, thank you very much.
public GameObject[] imagenesPuntosVerdes;
public GameObject imagenContenedor;
int cantidadImagenesSecuencia;
private const string Tag = "puntosVerdes";
void Start()
{
cantidadImagenesSecuencia = 100;
imagenesPuntosVerdes = new GameObject[cantidadImagenesSecuencia];
for (int i = 0; i < cantidadImagenesSecuencia; i++)
{
Debug.Log("Cantidad puntos verdes");
//el bucle funciona, pero no me encuentra las imagenes.
imagenesPuntosVerdes[i] = FindObjectOfType<puntosVerdes>().gameObject;
}
}