0
I have a list of Transform that contains the Spawnpoints I have within the game, I would like to find for each of the Spawnpoints their position.
[SerializeField] List<Transform> spawns;
The problem is to give Spawn to the cars if they are within camera limits, but Spawnpoints need to be outside to give the illusion that they are born outside and not inside. How can I access the position of each Spawnpoint in the list?
IEnumerator SpawnCars()
{
while (OnCamera==true)//enquanto os spawns estiverem dentro do ecra
{
yield return new WaitForSeconds(0.5f);//esperar um segundo para spawnar
Instantiate(car, spawns[Random.Range(0, spawns.Count)].position, Quaternion.identity, transform);//spawnar o carro na lista de spawns
}
}