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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Widget Blueprint HUD Duplicated On Begin Play

I'm using a Widget Blueprint for my in-game HUD, but when creating it in a multiplayer match it gets duplicated. I print out "Created HUD" within On Begin, which is printed out multiple times per client, and I also print out "Set Character" within the actual Widget, when I'm getting a handle to the character, which prints out negative clients.

This is what my HUD looks like within the editor, using 9:99 as placeholder text. alt text

And within a MP game, it gets overlapped by a second HUD, and only updates the newest one. alt text

Here is my blueprint in FirstPersonCharacter that simply sets up the widget. alt text

With dedicated server:

FirstPersonCharacter Blueprint

 LogBlueprintUserMessages: Client 1: Created HUD
 LogBlueprintUserMessages: Client 1: Created HUD
 LogBlueprintUserMessages: Client 2: Created HUD
 LogBlueprintUserMessages: Client 2: Created HUD
 LogBlueprintUserMessages: Client -2: Set Character
 LogBlueprintUserMessages: Client -2: Set Character
 LogBlueprintUserMessages: Client -2: Set Character
 LogBlueprintUserMessages: Client -2: Set Character

With listen server:

 LogBlueprintUserMessages: Server: Created HUD
 LogNet: Join succeeded: 361
 LogBlueprintUserMessages: Server: Set Character
 LogBlueprintUserMessages: Client 1: Created HUD
 LogBlueprintUserMessages: Client 1: Created HUD
 LogBlueprintUserMessages: Client -2: Set Character
 LogBlueprintUserMessages: Client -2: Set Character
Product Version: UE 4.7
Tags:
blueprint.png (132.4 kB)
timer.png (15.9 kB)
default.png (12.8 kB)
more ▼

asked May 29 '15 at 12:09 PM in Blueprint Scripting

avatar image

twitch.tv advice
8 1 3 6

avatar image g19max1 Aug 09 '15 at 07:40 PM

Did you ever figure this one out? I'm experiencing the same issue.

avatar image eXi Aug 10 '15 at 08:35 PM

BeginPlay is called on every PlayerCharacter in the Game. If you have a MultiplayerGame and you have for example 2 players in there, the BeginPlay function will be called twice per Game. One time for the main Player and one time for the replicated version of the enemy.

You want to hook a branch with a simple "IsLocallyControlled" in front of you widget things, then it will not be called on the replicated player, but only on the one that the player really controlls.

avatar image g19max1 Aug 11 '15 at 09:18 PM

Great answer. Thanks eXi!

avatar image TOXIC_Rize May 24 '18 at 07:15 AM

Thanks Exi also you can use the HUD class because thats what its meant for :)

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

0 answers: sort voted first
Be the first one to answer this question
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