Hi guys
i’ve a list of prefabs in a list to instantiate, but i would like remove it after the instantiate from a list.
I’don’t know why with this script if the count is major of 6, instantiate only some prefabs and not all.
Any suggestion
best regards
private void spawnBlock()
{
Debug.Log(cards.Count.ToString());
float offset = 2f;
int count = cards.Count; // Get remaing prefabs count
for(int i=0;i<count;i++)
{
Debug.Log(i);
GameObject go = cards*; // Get element from list*
Instantiate(go, new Vector2(this.transform.position.x, transform.position.y - offset), Quaternion.identity);
cards.Remove(go); // Remove it from list (avoid duplication)
}
}