I have this problem where the unity editor debug panel says that "the prefab you want to instantiate is null". I tried to search why did this happen but i don't know why. I have a prefab called "cube" and a camera called "camera" NOT "Main Camera". this is the code that goes into the prefab, "cube" :
function Update () {
if (Input.GetAxis("spawn")>0){
var cube:Rigidbody;
cube=Instantiate(cube,transform.position+Vector3(0,0,4),Quaternion.identity);
};
}
and this is the code that goes into "camera" :
var x:float;
var z:float;
function Update () {
x=Input.GetAxis("Horizontal");
z=Input.GetAxis("Vertical");
transform.Translate(0,0,z/5);
transform.Rotate(0,x,0);
}
Thanks in advance.