How do I get the current player's "player controller" (multiplayer respawn setup)?
I'm trying to create a simple respawn mechanic in my multiplayer shooter project. When a player gets shot, his life is decremented and when it reaches zero, he dies. This part works. Immediately after his death he's supposed to respawn. This is the part I'm struggling with. This is my setup:
As you can see, I'm spawning a new character at a preset location (where he's not colliding with anything), then destroy the actor he's currently controlling and immediately possess the new one. The setup above "works", but only for the player, whose index is 0 (in my case - the client). If I change the value to 1 it only works for a different player, obviously (this time, the server). As you can see from the image, I was trying a few different ways to get the player controller (get owning player controller, get instigator controller, get controller), but none of them work. I don't really understand the difference between them, so I just experimented. I don't have much experience with player controllers.
Does anyone have an idea how to approach this problem? I would be very thankful for an answer!
Follow this question
Once you sign in you will be able to subscribe for any updates here