Hey guys, I’m making a block puzzle game where a randomly generated set of coloured blocks needs to be dragged into a grid (think Columns). I need to drag all three items together so I was planning to make all of them children of an empty GameObject, but I can’t seem to make this work at all.
public class SpawnBlock : MonoBehaviour
{
public GameObject[] blocks;
void Start()
{
Vector3[] spawnPositions = new[] { new Vector3(-5, 0, 0), new Vector3(-4, 0, 0), new Vector3(-3, 0, 0)};
for (int i = 0; i < 3; i++)
{
Instantiate(blocks[Random.Range(0,6)], spawnPositions*, Quaternion.identity);*
}
}
}
I’ve tried making a GameObject to parent the blocks to but I’m getting errors whatever I try. Any help would be most welcome.