BCE0019: "RemoveItem" is not a Member of "Inventory"

Please help me what’s wrong here?

The Error code is: BCE0019: “RemoveItem” is not a Member of “Inventory”

function DeleteUsedItem()
{
if (item.stack == 1) //Remove item
{
playersInv.RemoveItem(this.gameObject.transform);
}
else //Remove from stack
{
item.stack -= 1;
}
Debug.Log(item.name + " has been deleted on use");
}

thank you a lot guys! :slight_smile:

So, you have an object named “playersInv”, that according to the error, is an instance of the “Inventory” class. You’re trying to call a method named “RemoveItems” that you expect to be available within the Inventory class. According to the error, the Inventory class doesn’t have a method named RemoveItem.

We’d probably need to see the Inventory class itself to provide much more input.

Jeff