GameObject Array

Hello,

I would to walk up to an object in my scene (first person controller), click on a sphere for arguments sake and a new object/cube will appear in it’s place, then if this is clicked another new object/cylinder will appear. Finally I would like to click on the cylinder and it will loop around back to the sphere, it’s key this cycle continues. I have been trying to use Array’s for this, I have successfully created a material array (from pieces of acquired script) but I have not been as successful for Object Arrays.

I hope this is clear, this is what I have in the way of script to begin with:

var arr : GameObject;

private var index : int;

function OnMouseUp ()

Your help will be greatly appreciated :slight_smile:

In that case, the script inplementing OnMouseUp would be attached to the sphere and the cylinder. You should add a variable called something like next. When the message OnMouseUp is received, you can deactive this object and active next.