//Thoose are objects that i have;
var shooterPlatform : GameObject;
var wireFrame : GameObject;
var passObj : GameObject;
var bareels : GameObject;
var randomObject : Array;
function Awake()
{
//--------------------------------------------------------------------------
//At there, Instantiate the object that selected randomly
randomObject = new Array(shooterPlatform, wireFrame, passObj, bareels);
}
function Start () {
var randomSelect = Random.Range(0,(randomObject.length)); //since you want to get a random object every time
// At there, if selected variable's name from array list is wireFrame,
// Applicate this code, if another else like, shooterPlatform, apply another code i wrote.
// I can't find how to get variable name from array list :(
var position = transform.TransformPoint(Random.Range(16.47816, -1.048871), 0, Random.Range(16.47816, -1.048871));
Instantiate(randomObject[randomSelect], position, Quaternion.identity);
}
I don’t know how to read selected variable can any body help ?