Hi all, I need a method to cycle trought an array of objects that I instatiate at runtime, at the moment I have this which instatiate only the first element in the array:
function OnMouseDown(){
var instance : GameObject = Instantiate(models[0],Vector3.zero,Quaternion.identity) as GameObject;
}
but how do I make it so that everytime I click a new element is instatiate and the previous one is destroyed?
Sorry I am not a programmer
Many thanks in advance!