guys making a game on zombie,it has rounds,scores,etc…
i have 3 spawnpoints → spawnpoint1 spawnpoint2 spawnpoint3
i want to select one of this 3 spawnpoints by using random… plss do help… i am attaching my code… plss do tell me what i need to write in → “randomSpawnPoint”
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManagement : MonoBehaviour {
public int round=1;
int zombiesInRound=10;
int zombiesSpawnedInRound=0;
float zombieSpawnTimer=0;
public Transform zombieSpawnPoints;
public GameObject zombieEnemy;
void SpawnZombie()
{
Vector3.randomSpawnPoint=zombieSpawnPoints[Random.Range(0,zombieSpawnPoints.Length)].position;
Instantiate(zombieEnemy,randomSpawnPoint,Quaternion.identity);
zombiesSpawnedInRound++;
}
}