I’ve tried multiple ways of writing the syntax. I’m on the verge of leaving Arrayl̶i̶s̶t̶ for rigid solutions and using list for more flexibility. Yet I have to solve this one or else I’ll feel like I’ve failed. Please help.
Only one object gets spawned and the array length stays zero.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class isolatingproblems : MonoBehaviour {
public GameObject cube;
int limit = 9;
public GameObject[] arrcube;
void spawn ()
{
for (int i = 0; i < limit; i++)
{
GameObject cubearray = Instantiate (cube, transform.position, Quaternion.identity);
arrcube *= cubearray;*
-
}*
-
}*
-
void Update ()*
-
{*
-
if (Input.GetButtonDown ("Jump"))*
-
{ *
-
spawn ();*
-
}*
-
}*
}