I've run into some trouble with replicating text over a network.
I'm using a widget to place a characters name above their mesh, and the text variable is set to replicate.
On the player controller, I have a string called player name, which is set to repnotify. When this string changes, the notify casts to the user widget, and sets the text based on the player name variable.
The problem I'm running into is that both characters will inevitable be named the same thing. For example, if I change the playername on client 1, the text updates accordingly. Unfortunately, client 2, on their end, is also named the same thing. Player 1 and Player 2's names change, but only on their screen.
Has anyone run into this? Does anyone know how I can get around this?
asked Aug 29 '18 at 01:29 AM in Blueprint Scripting
Don't use Get player character, instead use Get controlled pawn in your player controller.
answered Aug 29 '18 at 03:02 AM
In your OnRepPlayerName function you are called GetPlayerCharacter(0), which returns the character being controlled by the local player on each client, setting the name on the wrong character.
answered Aug 29 '18 at 02:58 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here