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"

Replicate Usernames in Widget Component above my Character

Hey Community <3 I came across a problem, I'm working on a fast paced game and I need names to show above the characters. Now i got HP bars that replicate perfectly and I scripted them inside the Actor, they share the same widget component as the usernames, however with this method both client and server see the same name above everyone. After that i tried couple of options but I just ended up with using player state which shows generated names that replicate correctly so server and client can see their names, but i want my clients to have their own usernames instead of randomly generated ones.

Here is a screenshot of my actual situation This one has generated names: alt text

and this is with players own username: alt text

Product Version: UE 4.18
Tags:
more ▼

asked Mar 24 '18 at 02:24 AM in Blueprint Scripting

avatar image

xcibe95x
8 3 2 7

avatar image xcibe95x Mar 25 '18 at 12:29 AM

Bump, Stil need help

avatar image xcibe95x Mar 25 '18 at 03:43 AM

Ok i realized i had to grab the player controller from the pawn Now i got Server to see Usernames correctly, but the client don't see any names except his own. I will try to go back to my player state method again but with a different approach and see if it works. i'll keep the post updated.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

I got it working after i don't know how many hours of testing each possibility. Thanks everyone for trying to help out. since i love unreal and it's community I will be sharing my solution thats still kinda confuse me, but it works lol So since i saw Server was able to see both usernames and client couldn't i switched back to the working system with generated names that you can see on the screenshot i posted before. I made some changes and i went crazy on that running the blood in my veins at 140BPM with high volume music. And i tought ok let's work on the custom playerstate again

NOTE: Each delay is necessary or otherwise this won't work this was the biggest problem in my script. Also be sure to set everything on reliable.

So thats what my custom Player State looks like, This changes the Generated Username to Custom One's but this wasn't enough alone to make all works. alt text

Now thats all you need in your Character BP, be sure all it's replicated even the components! alt text

Let's go to the Lobby Player Controller, this is a bit messy since i have a lot of Events inside But all you have to do is create a Custom Event On Server and reliable and connect the rest as you there. alt text

For your widget just set this basic and simple bind. Always be sure it's replicated ofcourse. alt text

And finally it should now works. alt text

(it's 7.27 am now and i really need to sleep sorry for bad english or any misstyped stuff. I'm really happy i managed to fix that)

more ▼

answered Mar 25 '18 at 05:50 AM

avatar image

xcibe95x
8 3 2 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

where are they accessing the usernames from? i think they are accessing from a save file or player controller and thus they are having the same username. If u try they in different pcs this wont happen if u still have problems join my discord at https://www.decodestudios.in

more ▼

answered Mar 24 '18 at 02:31 AM

avatar image

TOXIC_Rize
6 1 4

avatar image xcibe95x Mar 24 '18 at 02:43 AM

Hi, i tried accessing them from a custom player state, modifing original playerstate, game instance and a structure in my Lobby Player Controller, all gives almost the same thing. You suggest to try on different computers instead of local?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hi. In my case, I'm using player name for chat game. Player have to log in to join the server so I'm storing their name into the GameInstance BP and on BeginPlay inside the PlayerCharacter BP you can get their name always in the GameInstance BP. save it into you character BP and use it like you want.

more ▼

answered Mar 25 '18 at 01:11 AM

avatar image

Denis Lambert
305 4 4 8

avatar image xcibe95x Mar 25 '18 at 01:36 AM

I'm doing just the same with game instance but it will still show the same name on all players. However the chat and the other stuff show correct names, i think i'm doing something wrong or in the wrong place at this point

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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