What I am trying to do is to spawn humans that will simply pass by my charactarter, I have wrote a script
However constant spawning causes some flickering in Oculus, thus I want to redo it the way that all humans will be spawned at once and activated with time, but I am worried that humans will overlap each other and it will cause problems. Will be thankful if you could recommend me an elegant way to solve this problem.
void Spawn()
{
Debug.Log("Spawn Function Activated");
RandomHuman = Random.Range(0, humans.Length);
GameObject spawnedPrefab = Instantiate(humans[RandomHuman], new Vector3(transform.position.x, 0, transform.position.z), transform.rotation);
}
void Start()
{
InvokeRepeating("Spawn", 0f, 3f);
}
void Update()
{
SpawnWait = Random.Range(SpawnLeastWait, SpawnMostWait);
}