How can I have a basic inventory system and spawn an item when I call a function?

Well you can’t spawn non Actor class, you can try cast your inventory type to actor or change variable type in inventory items array from object type to some actor type.