Download

Help with inventory system

Hello!

I have items as childrens of a BP Item (just storing a class (to spawn if needed) and some variables (floats/bools)) and another actor for Inventory (array of BP Item and functions for adding/removing items). The point is that Im going to have an inventory per character and pawns, having at least 60-100 so, 1000-3000 items at same time.

  • Should I worry about having that many actors around? In terms of performance (PC). Item contains “name, actor class, float, float and bool”.

  • Any way to sort (place as child or something else) in the World Outliner to have Inventory as Pawn/Character child, Items as Inventory children?

Thank you in advance.

Hey here u can find an official inventory tutorial https://www.youtube.com/watch?v=RQm6cm05SLc

Thas said, for something more advanced and for your question:
Propably what you need is to create an Actor Component Inventory. You can place on any actor and access it easily. Store the items in an array and add any functionality you like. You can access it with a simple GET.

You can also use a component to store all your information. They work really nicely for things like this.

Actor Component! Just what I needed. Thanks a lot!