Slate widget SetVisibility in Multiplayer "doesn't work"

Could you show a little bit more? Are your widgets in singleplayer and multiplayer exactly the same and there is no other widget on top of your “faulty” widget which blocks your input (z-order)?How do you create your widget? Where?

Hey everybody,

I hate to just say “doesn’t work”, because for every other widget I have it actually does, but I have one widget that does not seem to respond back to SetVisibility call in the blueprint, only in multiplayer mode.

I am using the widget in only 1 single place. It contains an ‘OK’ button, that calls SetVisibility back to Hidden, from its own self, but continues to paint. It is completely unresponsive and in the widget reflector, it is still showing as Visible.

I must be doing something stupid wrong, but I can’t seem to find what it could be, so I’m looking for some “extra set of eyes” ideas on what could be happening? Again, it works perfectly fine in Single player mode; every other widget I have in the game respects it in multi-player, except this one. Any ideas?

I’m hoping to not have to recreate and see if that fixes it, but I’d like to ask for any ideas before I go down that route - thanks!

sure! Here are some screen caps. It’s really very simple. You can see, with all the working ones, here for example, a simple message dialog, when called, it will SetVisibility to Visible, then when the user clicks OK or Cancel, it calls SetVisibility to Hidden. This works just fine.

Then we have the Coin Toss dialog, which basically does the same thing - when requested, SetVisibility is called to set to Visible (works just fine), then when OK is clicked, SetVisibility is called and set to Hidden as well, but the widget still gets painted and in the Reflector, Visible has not changed.

The widgets are not created at runtime, they are placed and shown/hidden, rather than created/destroyed. There is not issue with Z-order, the results for the OK are clicked and processed just fine. These are pretty simple dialogs in blueprints. And again, the very same ones are used for SP and MP, with no issues at all in SP.

Thanks for looking, much appreciated!

I’m testing via listen sever using the ‘number of players’ in editor.

I do have a number of other issues I need to resolve, as the UI is only showing on the listen server, so I have a bit of work there to do at this point anyway, as to your point, the game mode cast IS failing before adding the UI to the client!

I will get this resolved first, then come back to this, I think this may be part of the issue, so this does give me a spring board to start with.

However, the strange part is that, when clicking OK, I can hide all the elements individually and that works, I just can’t seem to hide the entire widget. The other strange part is that it will show SetVisibility=true, but not the other way around.

Let me take with this idea you have for a few hours and I’ll post back here with results/questions, as I’ll have more information for you.

This is a bit of a mess, as the idea of MP came after the fact and much of the SP development was completed. A little embarrassing, to be honest, please don’t tell anyone :smiley:

Fortunately, for this, MP is literally view only, there is no input required from the client whatsoever…

So, you are testing this in multiplayer. How do you do this? I ask because I want to know if this happens for server and client or just one of them. And could you put a PrintString on the CastFailed of your CastToGameMode? I may be wrong, but I don’t know if you are allowed to cast to the GameMode as a Client.

You could try to create your widgets in your PlayerController and set owner as GetPlayerController. To get the right PlayerIndex of your PlayerController you could then create 2 Events in your GameMode: EventOnPostLogin and EventOnPostLogout. Login would be for incrementing your PlayerIndex and Logout for decrementing your PlayerIndex.

Closing this question out - redesign was required. Thanks L1z4rD89 for your input!