The interface does not work on the server but works on the client.

Hello. I am making an inventory system and I have a hotbar. When I pick up an item from the ground, the item I pick up on the server side does not appear in the hotbar. But it does appear on the client side. What could be the reason for this? I can add more images if you want. Thanks for your help.

What logic are you using to drive the ui?

You should be calling the pickup on the server passing in who is picking up the medkit.
Then you should change the passed in characters inventory on the server then calling the characters actor to refresh it’s hotbar.

1 Like

I’m sorry I didn’t understand what you said because I’m not very experienced. Let me tell you what I did. I created an actor component for the inventory. I added it to my character. I created a few structures for the items. I have an inventory window that I can open whenever I want. This always works fine on both the client and the server. But when I use it as a hotbar I encounter this problem. When I run the game as a standalone, everything works fine.

You should have a player character in your widget that is passed in as a reference. You cannot just use get player character 0 in widgets in multiplayer.

You are also not adding an owner when creating the hotbar. You could pass in the player controller and use get controlled pawn from owner to get the character too.

I would use the post logon function to get the controller of the newly logged in player and pass that in to the initialization of the hud or just use the AHUD class to hold the UI

1 Like

I’m a little confused. Why doesn’t the system that works properly in the inventory interface work properly in the hotbar? I used the same system in both. I tried a little but couldn’t make it work. I would be very happy if you could show me how to implement what you said.

you should use Construct in all the above examples not Pre Construct,

your inventory should be RepNotify not Multicast too

1 Like

No matter how hard I tried, I couldn’t solve the problem. If there are any tutorials that can help me understand this issue better, I would love for you to send them. Thanks for your help.

fps_simple.zip (8.5 MB)
Made a quick example project to show the hotbar in action. UE 5.4

Remember that updating on rep notify does not fire when you pick with a player on a listen server. You need to check if it is locally controlled and if so update the ui directly.

Press E to interact and pick up the items (boxes on level)

1 Like

I appreciate your time. I was about to lose hope and you saved my day.