Method of gettign rid of a widget on all players clients

Im tryign to create a waiting room /lobby where players go and sit till host starts the game. when host hits start game it should remove the widget from all clients including its own. i have tried this multiple different ways…

tried setting the lobby up in level blue print and then using blue print interfaces to remove the widget using the level blueprint which in turned called a rpc from the controller

ive tried this exact same set up in the game mode.
also from the player controller.

tried to call a rpc from the umg start button that goes to the server to tell the server to call a multicast rpc on all clients to remove it from parent

tried calling this from a basic event that which in turn would call the rpc to send to server which would call the multicast.

all these methods only work either a: for the server or b: for the client and this all consist of hitting a umg button that would call this actions.

ive done like 4 days of testing and always end up with only either or of the client or server gettign the widget to remove while it stayed on the other.

im at a complete loss now so im hopping someone might have a general set up they can suggest in order to do this…

thanks in advance !

I’m not sure how your adding widgets to screen, I’d suggest a mix of HUD class and ensure HUD elements are created and added to viewport from controller events so they truly belong to the player.

For example in lobby you may want to call to clients controllers to use lobby HUD class and in the game level call to controllers to use the a in level HUD class.

When controllers own there umg elements it’s easier to tell a controller to remove from parent.

Is locally controlled is an important node as well. If it’s a non dedicated server it’s likely on a player to be the server which means his calls will be concidered authority. While other clients are remote

Yeah they are all set to the correct player i was calling the credit widget from the first person controller from the begin play which would ensure it belonged to that character. since when players join game they are given a controller on post login. which is why im at a loss. so even if i pass the controller to the widget and check to make sure everything matches up it still wont remove it…

fixed this it was my own stupidity !

If anyone is wondering about the answer, I found a way to make it happen.
In the lobbyMap, you should have a LobbyPController to, either display the widget or destroy it ; in my case, since the players travel to another map, another playercontroller will be assigned to each and everyone, so I used the Event EndPlay(), that is triggered when the LobbyPController gets destroyed, which is the case here since they travel to another map. So I just made this very simple logic : Event End Play -> Get All Widget of Class (your lobby menu) -> Remove From Parent.
I hope it helped you since it worked for me.

1 Like