here is the code
#pragma strict
var SpawnPoint : Transform;
function Start () {
}
function Update () {
}
function OnTriggerEnter (man : Collider) {
if (man.GetComponent.<Collider>().tag == "Player") {
var element : int = Random.Range (0,SpawnPoint.length);
man.transform.position = SpawnPoint[element].position;
}
else {
}
}
//here is the error: IndexOutOfRangeException: Array index is //out of range.
//tp.OnTriggerEnter (UnityEngine.Collider man) (at //Assets/scripts/tp.js:17)
//please help!