I am sending information from my item to my inventory. Telling the inventory to add the item. Gives me a null reference exception.
Item.js :
inventory.AddItem(this as GameObject);
Inventory.js :
var items : ArrayList;
function AddItem (item : GameObject) {
items.Add(item.gameObject); //Error happens here
}
↧