I’ve figured it out. I had indeed a basic misunderstanding.
When a variable is replicated, it’s replicated from the server to the clients. Which means that the client does not replicate it to anybody.
Both dieFFS
and playername
were changed on the client, and therefore not replicated. To achieve this you have to create a custom event, say change name
, ran only on the server with the name as a parameter. This event is triggered by the client and then processed on the server. If you set the playername
variable as replicated it will now be sent back to the clients since it’s the server changing it.
In addition to that, I had forgotten to assign the new Animation blueprint to the TopDownCharacter which is why it wasn’t triggering the dying animation, since the ApplyDamage
was correctly computed on the server and its replication was actually working.