Happen on the server: On the ThirdPersonBP: Player dies - Spawn a new character - delay .2 sec - Posses - Cast to playercontroller -
(this should run a custom event on the client playercontroller) = Clear HUD -
then on thirdPersonBP: detach from Controller
long story :
So basically I would like to kill my player. My problem is that I don’t have access to the HUD after I spawn the new character. On the player controller, I create the main widget and store it in the variable ‘Main HUD’ which is own by player1, but when player1 dies and spawns as player 2 that character doesn’t own the ‘main HUD’ variable. Basically I think my best option would be to run a custom event on the client that clears the HUD and create the widget again. It works on a single player but the custom even will never run if the player is a client.
From there you use EVENT ON POSSESS to call “Set Controlled Pawn”. This will automatically set/update your Pawn/Character reference when the controller possesses a pawn. Once the Pawn reference is set you can then Load your UI elements.
*** Just for Note … You do not need a PAWN in order to load UI//widgets etc. The controller itself is the game world reference of you the player.
Pawn Movement inputs handled through the controller…
The controller processes inputs before the pawn class. So inputs should reside in the PC and call Pawn Events. The logic for the event should reside in the pawn class though.