Hello im trying to make my enemy spawn at one of three positions I creates 3 empty GameObject and i tried with Random.Range but it bugs a lot . Any ideas?
public Transform pos; // assign your objects in inspector
public GameObject obj;
void example(){
Instantiate(obj,pos[Randon.Rang(0,pos.length)].position,transform.rotation);
}
or you can use public Vector3 [] pos;
instead of creating empty game objects it’s up to you
edited you have to add .position after the Square brackets if you use public Transform [] pos;
but you don’t if you use public Vector3 [] pos;