how to instantiate pun agent

The PUN Spawn Manager will use the spawn points automatically when spawned. Make sure you have a valid spawn point and grouping setup in order for the spawn point to be valid.

 
I just write

public GameObject AgentPrefab;

public void Start()
{
Instantiate(AgentPrefab);
}

agent instantiated at zero position. not in spawn points.
please guide me on how to instantiate properly.
 
Maybe some like this work:


public Vector3[] spawnpointPosition; //here you put all your spawnpoint positions

GameObject.instance=
Instantiate((AgentPrefab), new spawnpointPosition[random spawnpointPosition], Quaternion.identity) as GameObject;
 
Last edited:
Top