Inventory - adanter/Prairie GitHub Wiki

What is it?

The inventory system allows players to interact with the world and its objects by picking them up, putting them away, or dropping them. This is meant to add a level of realism to the experience. We have provided two different inventory systems:

Classical Inventory

The Classical Inventory is the inventory system often seen in many role playing games. The player will walk up to an object, select it, and the object is put away into the 'backpack'. The player can then reselect objects from the inventory to drop them in the world. The player can put objects in the inventory by pressing key E and interact with inventory slots by pressing key I then left-clicking on the slots.

How to add items for the classical Inventory

The inventory comes with the Prairie Player! However, to add objects that can be added to the inventory, the developer must attach the InventoryInteraction script component to the desired object. Be careful with this, because this can be attached to anything, including the ground.

'Carry' Inventory

The Carry Inventory is our second type of inventory system. This allows the player to carry objects in front of them, similar to how 'Minecraft' or other games have objects that float in front to simulate carrying. The player can carry/put down objects by pressing key F.

How to add items

To add objects that can be carried, the developer must attach the carry script component to the desired object. Be careful with this, because this can be attached to anything, including the ground. TIP: if you wish your object to not just hang in the air where placed, we recommend you attach a rigidbody component to the object of choice. This will ensure that the object is affected by gravity.