Question by
jackwbarker · Dec 29, 2015 at 01:28 AM ·
instantiatespawnnot working
Instantiate not spawning anything
using UnityEngine; using System.Collections;
public class Game : MonoBehaviour {
public int numberOfCubes;
public GameObject cube;
public GameObject[] cubeClone;
void start() {
spawn();
}
void spawn() {
cubeClone = new GameObject[numberOfCubes];
cubeClone[0] = Instantiate(cube, new Vector3(1, 1, 1), Quaternion.Euler (0, 0, 0)) as GameObject;
}
}
Comment
Answer by OncaLupe · Dec 29, 2015 at 03:20 AM
Method names are case sensitive, void Start()
needs to have a capital 'S'.
Your answer
Follow this Question
Related Questions
gameobject doesn't spawn in the assigned random positions? 2 Answers
Trying to spawn enemies on only one path 1 Answer
Networking - How do i spawn an object with client authority? 1 Answer
Spawning limited GameObjects at a specific position not working 1 Answer
spawn object every 10 score points 1 Answer