I created a little sprite in the editor called lightpink and assigned it to a little script that runs movements. How do I proceed to create more of that object in a control script?
public class SpawnObjects : MonoBehaviour {
private List<GameObject> pinks;
// Use this for initialization
void Start () {
pinks = new List<GameObject>();
}
// Update is called once per frame
void Update () {
CreateNewPinks();
}
private void CreateNewPinks()
{
if (Input.GetKeyDown(KeyCode.Space))
{
//Magic
}
}
}