I’m working on a code that hopefully would allow me to spawn a bomberman styled arena on load. I have the “box” prefab made and a grid of empty gameobject “nodes” in which I’d like to spawn these box prefabs.
right now the code creates the correct number of boxes, but says the array I assigned the nodes to is out of range, thus spawning a bunch of boxes to the center point of the scene.
Public class spawnBoxes : MonoBehaviour
{
public Transform[] spawnNodes;
void Start ()
{
GameObject prefab = Resources.Load ("box") as GameObject;
for (int i=0;i<64;i++)
{
GameObject go = Instantiate(prefab,spawnNodes*.transform.position,Quaternion.Euler(0,0,0)) as GameObject;*
-
go.transform.position = new Vector3 (5, 5, 5);*
-
}*
-
}*
}