No answer, project abandoned
Prefab not Instantiating
Hi, I'm having a problem Instantiating a prefab, there are no error, it does Instantiate if i remove the Collider2D, but if i add it back it does not.
if (timer <= 0) {
position = new Vector3 (16.5f, Random.Range (-2.49f, 2.64f), 0);
enemyselected = Random.Range (0, enemies.Length);
if (PlayerPrefs.GetInt ("enemies") < enemyNumber) {
Instantiate (enemies [enemyselected], position, transform.rotation);
timer = 10;
}
}
I'm trying to call the gameobjects from an array ramdonly, i'm doing it this way because i need to reuse it in different scenes, and keep adding more and more, I am having the problem with the second gameobject i am trying to add, the first one works, i tried to duplicate the first one and changed the sprite, and it actually works, both of them instantiate, but when i resize the collider2d it does not instantiate again, any ideas?
You only left the question up for part of a day before closing it, it looks like. I would've wanted an answer to this...
Follow this Question
Related Questions
Using constructors in Unity (C#) 8 Answers
Performance of instantiate and destroy for bullets 2 Answers
Instantiate objects around a sphere 2 Answers
More problems with arrow shooting 0 Answers
Instantiation of my GameObjects spell (from other script) 0 Answers