Death screen broadcasting to all players - help plz

I’m attempting to develop a multiplayer hide and seek game but when I try to display a death screen to the hider which gets killed, it broadcasts the widget to the seeker (and presumably the other hiders) and shows the death screen to both characters (actors, pawns?)
I’m on day 2 of my 5th attempt at learning game development (second time trying Unreal) so I apologise in advance for the subpar efficiency of my coding
The order in which I connect the Widget creation vs the Play Montage node didn’t effect it, I have tried using Get Player Controller. The montage and Destroy Actor node only effect the correct Hider, the issue is purely associated with the widget
Any advice or solutions will be greatly appreciated, thanks :slight_smile:

  • James


make sure the damage is only run on server

Create a ClientDeathEvent on the playercontroller, make it RunOnOwnerClient (rpc) called from the server on death

put the widget stuff on the player controller event. this is because if you destroy the actor the RPC could fail

Heya Boss, really appreciate the super quick response. I’ve spent the time since your reply watching 2 videos regarding replication and RPC’s and have implemented what I learnt into my Seeker character, but I can’t figure out what you’re suggesting to do. I made the ClientDeathEvent but have no idea where it needs to be plugged into. My attacks are being handled/ traced on the Seeker BP, whilst the damage received is being handled by the Hider BP (which I sent earlier along with the little widget piece). Still puzzled unfortunately. I’ll also attach my damage dealing code incase
Cheers

create 3 events, ServerDeath, ClientDeath and MulticastDeath

so on death (ie health=0 branch) call ServerDeath which only runs on server. and remove everything else

On ServerDeath call ClientDeath(RunsonClient) and MulticastDeath(RunsOnAll)
OnClientDeath do widget stuff
OnMulticastDeath do AnimMontage

And remember dont destroy the actor otherwise the montage wont play etc

1 Like

I think I followed along correctly, although I’m really not sure I was following myself whilst doing it. With the following code, the hider does get hit successfully, IF the Seeker is the server, but not if they’re a client. And the animation is still being sent to the seeker delivering the successful blow? On the bright side it doesn’t get sent to the seeker running as a client, though that leads me to believe that it also isn’t being sent to the hider who dies. I really wasn’t expecting to get this lost until I got into match making and actual SERVER stuff :confused:

server death hence the name is run on server

and client death seems to be calling itself? youd get an infinite loop there except it doesnt have permission

other than that it looks ok, and welcome to replication :wink:

1 Like