Best practices to replicate an inventory (multiplayer)

Hey and thank you for your reply,

I like the idea of a TMap/Array etc. I quickly blueprinted something.

  1. I created an inventory actor which I spawn on the server inside the character on begin play event. (working)
  2. This actor class then creates an empty array of item actors for the server (working)
  3. (Adding to Inventory) I am using RPCs, so the character triggers a line trace event on the server to call the delete actor function (working because my usable actors are replicated) and add the item struct to the array, so every client has its own array on the server (working)

Doing it this way completely prevents the replication of the whole array/inventory. But how can I access that variable on the client for example for updating UI like HUD? I could add functions like “getInventory” or “removeFromInventory” inside the inventory actor class and return the array of items. Do you think its possible or am I wrong?

Greetings