Instantiated objects appear invisible.
Im trying to instantiate objects randomly to populate a map, i had this same script working before, but when i applied it to multiple different objects and run, it creates the new objects with no differences from the originals except the name ex. Tree_1(clone). And the cloned objects are invisible in camera and scene view, i tried moving around the camera the ground. They are spawning in the correct location they are just not visible. I read some other people calling this a bug.
Im probably doing something wrong here, any help appreciated :)
public class Spawning : MonoBehaviour
{
public Main a;
public GameObject gameObject;
void Start()
{
Instantiate(gameObject as GameObject, new Vector3(Random.Range(500, -500), Random.Range(0, -1),
Random.Range(500, -500)), transform.rotation = Quaternion.Euler(0, Random.Range(0, 360), 0));
a.numSpawned++;
}
Your answer
Follow this Question
Related Questions
is there simple way to put random sprite to gameobject multi child with no repating. 1 Answer
How to spawn randomly with multiple gameobject 2 Answers
Need to randomly place Waypionts from an Array in an "closed" 2D space 0 Answers
Battle stations for my RPG game 0 Answers
Stuck with my First AR game 0 Answers