Help with creating inventory system that supports item amount

Hello. As the title says, I’m in need of creating an RPG inventory system that supports storing several of the same item with an item count (think Bethesda titles on the Gamebryo/Creation engines). Searching for tutorials on this only result in ARPG-esque or single-item-per-slot approaches, which doesn’t provide all the solutions I’m looking for.

Currently, this is what I’ve set up as a proof of concept to iterate upon later:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerManager : MonoBehaviour
{
    public List<Item> playerInventory = new List<Item> (50);
    public float playerWeight;

    public void AddItemToInventory(Item itemToAdd)
    {
        if (itemToAdd.itemID != null)
        {
            playerInventory.Add(itemToAdd);
        }
        else
        {
            Debug.Log($"{itemToAdd} is an invalid item.");
        }
    }

    public void RemoveItemFromInventory(Item itemToRemove)
    {
        if (playerInventory.Contains(itemToRemove))
        {
            playerInventory.Remove(itemToRemove);
        }
        else
        {
            Debug.Log($"{itemToRemove} does not exist in the player's inventory.");
        }
    }
}

So uhh… what do you need help with? It seems like you have the right idea.

ScriptableObjects are the solution for you. They are the best to keep values.

Well, specifically I need help coming up with a solution where I not only can store items in a list, but also can show these items as a stack in the inventory, and this is what I’m clueless about.

I know ScriptableObjects are a good solution, but not something I’d consider for the inventory management itself. Items themselves in order to simplify item making later, sure, but I’m talking having an inventory system that takes into account how many of the same item you have in your inventory.
EDIT: Oof, didn’t have my cookies settings in order, so I didn’t have the ability to open up the video and see what the video described. Thanks for the suggestion.

You could create an object which derives from Item which is a stack, that might work.

depends on how many different types of items you have, but i would just have one player inventory list, and when the player opens his inventory, just have a script scan the list to count/create stacks. It could count stackable items as one item if < than max stack size.