im getting this error: NullReferenceException: Object reference not set to an instance of an object Item.Start () (at Assets/Scripts/Inventory System/Item.js:9)

i have been looking for a solution for 2 hours now, i hope some of you guys can help me.

the error message:
NullReferenceException: Object reference not set to an instance of an object Item.Start () (at Assets/Scripts/Inventory System/Item.js:9)

here’s my script:
#pragma strict

var objectName : String;
var amount = 1;

function Start () {
	objectName = gameObject.name;

	transform.Find("Player").GetComponent(InventoryMemory).InvUpdate(objectName, amount);
}

function Update () {
}

transform.Find(“Player”) will try to find the child GameObject named “Player

API: Unity - Scripting API: Transform.Find

Perhaps the GameObject Player isn’t a child object but another GameObject elsewhere?

In that case, you should use GameObject.Find(“Player”)