Download

Umg in multiplayer and pie

I am not sure if this is how I’m doing it or just a bug in pie.

But I have a few different classes of pawns.

  1. Spectator aka player select
  2. Red player
  3. Blue player

I have a umg that in event begin play inside of spectator it shows an option to select team.

This umg casts to playerstate and changes your team enum. Then calls a respawn function which destroys you and spawns you.

I have a choose player start override that selects sown point. Based on that enum.

I have a choose default pawn based on that enum.

Now this all works fine… Except.

When the player is spawned the umg doesn’t go away.

If I set the pawn to remove the widget from parent it removes it for everyone.

I’ve tried putting a remove from parent in spawn of the new character, on the click of the button.

On the respawn function or call to that function in the spectator class.

It always removes it from everybody.

Does anyone have working example of spawning players with a umg and on click it removes it from just that player?

I’ve managed to get this working… I’ve moved menu calls to player controller and from umg I pass owning controller to cast to PC dnd make changes.

Effectively I default everyone to a custom character that acts as spectator. It shows a umg… This umg allows you to select a team which changes your default class to a team… Which you then spawn as and can run around…

A button on PC can recall the menu to change teams or go back to spectator.