Cant pass Widget reference from server to client

A sever generally doesn’t implement any kind of U. You have to do the replication in your pawn or player controller and adapt your UI accordingly on the clients side.

That document was very helpful thank you very much ok so if I can’t pass wiget variables around then any suggestions on how to get what one was clicked I saw in that compendium him passing a click event in but I need to know exactly which one was clicked and update its image variable from the item and depending on which one was clicked I’m storing the item server side in a variable on that pawn each variable named for each slot

So after beating my head against this and checking literally everything to see who has a reference to what variable I finally came to find out that the widget ref I was passing from the server to the client never gets sent even when replicated and/or reliable

ok so here is the scenario I have a left and right hand they are a component widget of my players UI they are a custom widget that I added to the UI manually not in code and I want to switch between them I set this to the Tab key in my inputs and fire the event in my player controller as well I create and set a reference to the UI in my player controller and in my pawn I set the left and right hand and the currently active hand to references now with all that

in my player controller off of the tab pressed I fire run on server which then says if active hand ref is the right hand ref then set left hand as the active hand and vice versa then pass the active hand through a run on owning client event for the highlight function in the UI

only the problem is the active hand ref never gets sent to the client its always null if I check the clients version of active hand its auto set to the right hand that prints out correct if I check the server side before and after everything comes out correct only after I pass it through the run on owning client does it come out null

I tried looking it up and I cant seam to find anyone else with this particulate problem and I dont have any screen shots as I have changed this from sending the active hand to sending an integer then just saying if its 0 then its the right hand if its 1 then its the left the problem with this is that down the road I wanted to put items in inventory slots and having all the inventory slots represented hypothetically by numbers makes it really hard to figure out what everything is supposed to be a reference to

So if anyone has any ideas as to why you cant send widget ref variables from server to client I would like to know or maybe a better work around then sending integers all over the place

oh also the custom widget is just a button with an image in it made it easier to use that instead of making a ton of on clicked events for each slot in the players UI

Ok so this is were my widget gets created in my player controller

This is my hands getting referenced and set in my pawn

This is the swap hands code the ActiveHandNum used to be just active hand inventory widget ref which is the custom widget component

And this is the function for the swapping of the hands

now I tried passing the active hand variable from the client side to the server side switching it and passing it back didn’t work tried implementing swap hands on both side so the server could be updated with the the current hand of the player but nope something else would brake either the client or the server could no longer switch hands I guess the only thing I haven’t tried is doing a switch has authority but I cant see why even if the server didn’t have the players UI which if I can print what hand they have and get the right variable it should but what ever why can I not just pass a variable around and change what its supposed to be then send it back I dont get it

Your Slot refferences dont exist on the Server. Server will never Create any UI. In your Swap Function they will always be null. Think of your UI as read only. Here a nice refference that can explain it better than I can =)

(How) Did you manage to solve this?

I give you a Example.

Imagine you have a Inventory on your Character filled with Items. You create a Widget localy to display them and interact. If you click a Item you notify your Character what you clicked and your Character in turn can tell the Server what he clicked. The Server was not involved in any UI buisness.

If you think of something like a Trade window between two Players you have a local UI for “each” Player and not a single one both interact with. So P1 Drags a Item into Trade via his local UI, P1 Character would tell the Server that he added ItemX to trade, Server would forward it to P2, when P2 recives the message he tells his local UI to display ItemX. Then both hit the confirm Button that again will go trough their Characters to the Server who in turn makes the actual exchange of Trade goods and send a message to both Players afterwards so they know when they can remove their no longer needed local UI.

Hope you can See on this Example that the Server never knew or interacted with the UI or the Trading Players never tried to access the others UI.

Good luck and have Fun =)

What are the nodes required for the server to be able to distinguish which clients are trying to trade and properly exhange the information between the two player characters involved?