x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Replicating Text

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?

alt text

alt text

alt text alt text

Product Version: UE 4.20
Tags:
bprep.jpg (64.8 kB)
chatname.jpg (30.6 kB)
bp1.jpg (48.5 kB)
bp2.jpg (53.4 kB)
more ▼

asked Aug 29 '18 at 01:29 AM in Blueprint Scripting

avatar image

Havoc
287 21 20 36

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Don't use Get player character, instead use Get controlled pawn in your player controller.

more ▼

answered Aug 29 '18 at 03:02 AM

avatar image

SenToRious
470 4 6 10

avatar image Havoc Aug 29 '18 at 03:29 AM

I used both yours and Manoel.Neto's comments, they were spot on. thanks!

(comments are locked)
10|2000 characters needed characters left

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.

more ▼

answered Aug 29 '18 at 02:58 AM

avatar image

Manoel.Neto
107 2 3 3

avatar image Havoc Aug 29 '18 at 03:29 AM

I used both yours and SenToRious's comments, they were spot on. thanks!

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question