Download

(SOLVED) Please help me understand what I am doing wrong (replicate player "death")

Unreal Engine 4.22.3
Listen Server

Some things I got to work properly by now and feel like I am understanding the replication generally better after some time now. Also, I looked quite often into which blueprints exist where and who owns what. I just cannot wrap my mind about it 100% yet, it seems, so I’d really appreciate some help in this.

So in the player controller bp I trace under the mouse cursor for other players, when I left-click. If it found a player character, I want to run the “death” event in the character bp. The replication works fine, when it is run by the host, but when a client clicks on another player, the event is only happening client sided. I actually thought it should work, as I set it up.

I also have set this up a second time, in an (almost) empty project, to have more clean space to just try it out and send it out, in case someone might request it.

EDIT: When the client clicks his own character, the player “death” is actually replicated fine. I really hope someone can tell me what I am doing wrong.

This is the TopDownController:

And this is the TopDownCharacter:

After trying some things, if I understand it correctly, I am unable to do it like this, just because I am doing it from the PlayerController. From the Level BP it works fine. Makes me wonder how would I actually make a player kill another. I already thought it is fine like that, because the “KillPlayer” event is run from the PlayerController, though it is entirely scripted in the CharacterBP.

You run an RPC on the server, have the server kill the player and multicast the event back to all others.

Sorry, that did not help me much, as I understand the logic behind it and I fixed the issue now.

My issue was this: I did not see one crucial thing and it was the first executed function was NOT replicated, which I assumed would be done by the replication down the line from the function in the CharacterBP. All I had to do is replicate the function in the same way in the ControllerBP. My replication was fine, just that the first part of the function (in the ControllerBP) was NOT replicated.

Thanks for the help anyways! :slight_smile: