Download

Multiplayer Inventory

The inventory is a BP actor and I wonder where should it be spawned?

Should it be spawned inside the ThirdCharacter BP or in the player controller? I’ve tried to spawn the inventory actor in the player controller, but if I load the game with a Listen Server, only the client will show the slot inside the inventory widget (the server/client won’t show any slots). On a dedicated server, the widget works for every client. When I spawn the Inventory in the ThirdCharacter BP, everything works, but only 1 inventory will be spawned.

Should every player spawn an Inventory Actor? For now, only the client #1 spawn a BP, all other clients won’t spawn any Inventory Bp (they still can use an independent inventory from another client). It’s always the first player connected that spawns the inventory.

Does anyone have any tips?

Create an Actor Component class (BP) and add it to the character class bp via “Add Component” … don’t spawn it.

Thanks, I’ll try that.

So right now my inventory is an actor Bp, should I rewrite all the functions inside an Actor Component? Is there a way to quickly do that or I’ll have to manually copy/paste all the function?

And I guess I’ll have to add this component on every item that uses an inventory? ex: a storage chest, campfire, or crafting table.

Or I use the component to communicate with BP?