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. 

HUD widget reference wont set on client

Im making a grid-based inventory system and when an item is picked up i want to update the image thumbnail inside the inventory. To edit the image im setting the hud widget to a variable when its created so i can edit it directly when an item is picked up. It works fine for the server but the problem is that the variable never gets set on the client and is always none so i cant access any of the variables within the hud widget.

The image below shows where the widget is created (if it helps i recreated the multiplayer shootout demo to use as a starting point) and what it looks like when the server and the client both pick up an item alt text

Its definitely a problem with the widget reference and updating the image because the item is getting placed in the inventory array for both the server and the client

alt text

if anyone could help me fix this or find a workaround it would be much appreciated

Product Version: UE 4.11
Tags:
more ▼

asked Apr 12 '16 at 06:59 PM in Blueprint Scripting

avatar image

GZMO
8 2 3 6

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

1 answer: sort voted first

Only thing i can think of is replication of HUD varable, UI should only exist in client and not replicated and HUD it self should visualize game state seen in client memoery at most get info call from replicated function calls in other classes to inform client HUD to do something

Also PlayerController exists only in server and in client which PlayerController belongs to (if i'm not mistaken) maybe there problem in this. GameMode exists only on server if you do stuff to HUD from there

more ▼

answered Apr 13 '16 at 12:29 AM

avatar image

Shadowriver
36.6k 931 169 1111

avatar image GZMO Apr 13 '16 at 07:57 AM

Ive tried replicating the variable and not replicating it. Ive also tried creating the widgets in event beginplay to bypass everything in the game mode, which didnt work. I created a new project and tried the same setup (using event beginplay and leaving gamemode default so everything is done inside the player controller) to see if that helped but still got the same results, not sure where to go from here.

(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