Hi!! I’m a beginner in unity. I want to know how to insert my gameobjects randomely in positions of a 3*3 matrix form. Please help me. Also guide me about the topics that I have to study if you could. Thanks in advance.
This should Create a 3x3 Objects then you have to spawn randomely in the position of cubes
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
GameObject tmpGb = Instantiate(Resources.Load("Cube", typeof(GameObject))) as GameObject;
tmpGb.transform.position = new Vector3(j * 1.5f-3 , i * -1.5f+3, 0);
}
}