Hello!
I’m trying to run this code from the Unity manuals:
public GameObject Enemy_prefab;
private Vector3 position = new Vector3(0.0f, 0.0f, 0.0f);
void Start () {
for (int i = 0; i < 10; i++)
position = new Vector3(i * 2.0f, 0.55f, 2.0f);
Instantiate(Enemy_prefab, position, Quaternion.identity);
}
But instead of making 10 objects, it makes just one. What am I doing wrong? The code is straight from documentation Unity - Scripting API: Object.Instantiate
Thank you.