Hello Guys, I’m 15 years old applicaton developer from turkey. So I have a problem about a script.
#pragma strict
//---------------------------------------
var waitFor : int;
var waitMin : int;
var waitMax : int;
//-----------------------
var possibleLeft = new Array(RCloud1, RCloud2, RCloud3, RCloud4);
var possible;
//-----------------------
var RCloud1 : GameObject;
var RCloud2 : GameObject;
var RCloud3 : GameObject;
var RCloud4 : GameObject;
//-----------------------
function Awake (){
possibleLeft = Random.Range(0, possibleLeft.length -1);
}
function Start () {
cloudScript ();
}
function cloudScript () {
waitFor = Random.Range(waitMin, waitMax);
Instantiate (possibleLeft, gameObject.transform.position, Quaternion.Euler(0, 180, 0));
yield WaitForSeconds(waitFor);
}
There’s my code. When i save it Debug Log gave me theese errors.
#1 = “Cannot convert int to Array” (28,28)
#2 = “No appropriate version of ‘UnityEngine.Object.Instantiate’ for the argument list ‘(Array, UnityEngine.Vector3, UnityEngine.Quaternion)’ was found.” (44,13)
What shall i do ? Please help me ! I’m stuck on this part. I want to create random clouds that will move around from one spawner. Thanks for reply.