How to manually add item to inventory

Velcer

Member
Hello,

I do not want to use the built in pickup system. Instead I just want to equip an item via my own methods. Is there any way to do this? Documentation isn't giving me any tips on this one.

The item I'm equipping shouldn't be attached to the player, but rather be a gameobject created by the item manager.
 
The item I'm equipping shouldn't be attached to the player, but rather be a gameobject created by the item manager.
So a runtime pickup item? You can call Inventory.AddItem to add the item to the character, and then Inventory.PickupItem to actually pick up the item.
 
Hey, this is what I was looking for. I'm using the LWRP, and upon using this I encountered this error.
1369
Is there anyway this can be resolved without rewriting code?
 
It looks like you are adding a prefab rather than the actual item instance.
 
Yes, I need to provide a prefab because the character would otherwise have no way of knowing what the item is, or what model it should have, right? :unsure:
 
You can use the prefab to determine what item to instantiate, but when you do the actual adding of the item you should use the prefab instance rather than the prefab itself.
 
Top