Can you delete widgets from all players at once?

Is there a way for a player (the host) to force everyone from the lobby to remove the widget (a menu from where players chose their team)? I tried making it so if the player with server authority presses a button it gets all widgets of that class and removes them from parent but it doesn’t work.

Make event on server that collapses this widget.
When player with authority wants to close widget let him trigger event on server.
Do not remove widgets, just collapse them and make inactive.

So I guess something like this? But it only removes the widget from the “admin” this way. (i used remove from parent to test faster)

](filedata/fetch?id=1807777&d=1599140274)

Hi, widgets don’t replicate (therefore you cannot meaningfully call RPCs on them), they only exist locally, so the server does not know anything about the widgets of the clients. Therefore “GetAllWidgetsOfClass” will only return the server widgets when called on the server.

Some “special” actors have some constraints about where they exist and how they replicate, you can take a look at page 9 and 10 of this here http://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf

And how can i force every player to delete a widget if the admin launches the game? The widget is a team selector one.

Basically you need to reroute this through an actor that does replicate.

You could do a multicast inside an actor that does replicate and then inside the multicast remove the widget.

Can you show me a visual example of this?

Sure, something like this

And you would call the “RemoveWidget” event to remove the widgets (so you would need a reference to this replicating actor inside your widget).

2 Likes

Already solved a few hours earlier with something like that but with an interface + multicast event. Thanks tho!