Hello,
I’m trying to make an item/inventory system and I need to make some generic/base classes that all items will build out of. Therefore, I was wondering what’s the best way to make these items?
Firstly, I though making an empty class the generic one, but realized I also need some of my items to be visible in-game (so they need to be actors). But as far as I know, it’s not possible to have an actor derive from an empty class, right? Atleast not without any major engine reconfigurations.
Then I was thinking about making all items derive from AActor, but isn’t this very expensive? I mean, not even 5% of my items will ever need to be visible in the world (so they don’t need the actor-implementation).
Lastly, and my most resonable solution in my mind, is to make one empty class, which will be the generic item class. Then whenver I would want my items to be displayed in the world I could make an actor class, link it to its respective item class, and go from there.
These are just a couple of thoughts and solutions I had, but I’ve never really done this before so I’m posting this question here to get some help from this amazing community. My question is then, how would I go about making such a class hierarchy? Any help would be greatly appreciated, thanks in advance!
~Stefan