Search Unity

Inventory system (third person) pls help!

Discussion in 'Scripting' started by M_Keyla_M, Jun 9, 2020.

  1. M_Keyla_M

    M_Keyla_M

    Joined:
    Dec 24, 2014
    Posts:
    57
    I wish to create an inventory system.
    I had the idea to have a cauldron have its own inventory. The (third person) player adds objects to that inventory by dropping objects into the pot (hitting the collider of the water, the water is a separate object)
    The crafting system uses that inventory to create potions.
    The only issue is that I’m very stuck with getting the cauldron to work with an inventory. I already made a UI but I don’t get how to make the cauldron register when the object hits the collider and to add that object to the UI
    Any tips? Or help? I really suck at scripting

    Here's what im thinking so far, please add to it:

    Inventory System

    What scripts do I need?


    • Inventory (inventory for the cauldron so you can craft potions)
    • Inventory slot?
    • Item (so my 3d objects can be added to the inventory)
      • How do I turn my 3D object into an item though? Need additional script?
    • Collider script? (to notify the inventory when an object has passed through the collider of the water in the cauldron)
    Inventory script

    • Public class Inventory : Monobehaviour?
    • ????

    Item script (complete?)

    • Public class Item : ScriptableObject (so i can create items without the need for codes every 3 seconds)
    • [CreateAssetMenu (menuName = “Inventory/Item”)}
    • Public Sprite Image
    • Public string Name
    Collider script?

    • ????