Instantiate randomly from array

Hello,

I try to make a game where an object appears one 1 of the 9 available places.
But it sems that it doesn’t work. Any help?

This is my code:

#pragma strict
var amplifier : float;
var Pos : GameObject[];
var popupObject : GameObject;

function Start () {

}

function Update () {
	var instPos = Random.Range(0,(Pos.length - 1));
	Instantiate(popupObject, instPos, transform.rotation);
}

You know what you forgot :slight_smile:

Instantiate(popupObject, Pos[instPos], transform.rotation);