How can I get an interaction widget over items for multiplayer game

Hello,

In the current state of my game, I have made a system looking like New world. When I get in a far radius of an interactive item, a little round widget appears and if I get closer, a “press E” widget replaces it. When multiple items are in the close radius, I start a linetrace to choose which actor I’m looking at/toward and only show the “press E” widget on the appropriate item. The whole thing looks great but fails to work when in multiplayer and the problem comes from how I have done it.

I have an interaction component I put on my character and the two widgets attached to my base item blueprint but set to not visible. When I get closer to the item, I set the right widget visibility as wanted. Doing so also helps me choosing the location a widget will show depending on the item. The problem is: in multiplayer, it makes the widget visible for everybody.

I have been looking up online at several kind of similar problems but none actually gives a solution that would fit my problem.

-I could set the character as owner of the object and do a “only owner see” but then if two players are in radius of the same object, only one would see.
-I have thought of giving my objects a socket for the widgets and attach them as wanted but I am not even sure you can attach a widget to a socket as I couldn’t figure it out.
-I have also thought of adding it to the viewport and somehow getting it to stay over the object but this solution seems very tedious and costly.

I am pretty sure there is an easy solution with a node/functionality I am missing here :smiley:

If anybody has an idea about how to solve that problem, I would be delighted to hear it !!

Cheers

For whoever comes across the same problem, I found the solution:

Every time you want something to happen only on the client and not on the server, before making the call, get your player controller> islocalcontroller into branch and do the call on the true.

This way, only the client will call whatever you put after and not the server !!

Cheers

3 Likes

Godspeed fam