var customer:GameObject;
var maxCustomerNumber:int;
private var customerArray:Array;
function Start()
{
maxCustomer = new Array(maxCustomerNumber);
}
function Update ()
{
for(var i=0;i<maxCustomerNumber;i++)
{
if(customerArray[i] ==null)
{
customerArray[i] = Instantiate(customer,transform.position,transform.rotation);
}
}
}
i always get this error "object reference is not set to an instance of an object "
on this line
if(customerArray[i] ==null)
and after that i can’t click anything on unity (i cant even close an error window) and force me to restart unity .
anyone pls help ![]()