Hi,
I have a question about how to replicate in a situation where you have an ActorComponent that is modified by a UserWidget. To give more detail:
- I have an inventory system that essentially is an “InventoryComponent” (derived from ActorComponent) that I add to Actors. It is basically an array of items.
- I’ve added an InventoryComponent to my main playable character.
- The main playable character uses a HUD class to manage it’s HUD. The HUD class creates and hides the UserWidget’s that interact with the player’s inventory. It is a spatially based inventory system, essentially 1-1 from Reid’s Spatial Inventory System if you are familiar with that tutorial series.
- Clients modify their InventoryComponents via DragAndDrop operations on the UserWidgets.
- The server “Accesses None” or dereferences null because the server does not have UI, and therefore cannot process information provided by the UI.
So basically the situation is that clients interact with their HUD classes to make changes to their InventoryComponents via DragAndDrop. These changes need to be replicated to other clients, but the problem that I run into is that when I set up “Run on Server” or “Multicast” custom events to add items, the server cannot process the item changes because the server cannot reference the items being DragAndDropped.
How can I set things up so that when a client drag and drops something, that it sends data to the server to be replicated to all clients?