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"

HUD Problem

Hi , i've trying to gathering coin by mouse click and show total of coin number on HUD, but amount of coin that be gather and shown on hud is always 0 (zero) and does not change. please help .

Product Version: UE 4.8
more ▼

asked Aug 02 '15 at 10:03 PM in Using UE4

avatar image

Student 24
18 9 11 13

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

1 answer: sort voted first

Ok first of all, what is the Actor Reference in the Wool actor? Is that a reference of the HUD? Where do you set that? If it is the HUD, you can just get "PlayerController 0" and "GetHUD" and then cast it to your HUD Class to increment the int variable that is in the HUD Class.

Summary: Delete "ActorReference" variable in HUD Blueprint. Remove the whole "GetAllActorsOfClass" part.

Delete the "Number_Of_Coin" variable in your WOOL Blueprint, you don't need that. It is already in the HUD. Also remove the "ActorReference" variable there too.

Get the PlayerController0. Get the HUD from it. Cast the HUD to your custom HUD BP. Get the Int variable from it and increment that.

Extra Information: Use an "IsValid" node for your Reference variable to make sure that they are not NULL (they can be empty if you don't full them).

Avoid using "GetAllActorsOfClass". This is an expensive node. Try to get the reference otherwise. For example by either Spawning the Actor and saving it directly in a variable.

OR (if the actor is already spawned) select it and create a directly reference in the LevelBlueprint

more ▼

answered Aug 05 '15 at 07:12 PM

avatar image

6.8k 333 185 468

avatar image eXi Aug 05 '15 at 09:28 PM

I rewrote the answer, since i did not really see the way you wanted to do this. Now it should be correct :X

avatar image Student 24 Aug 06 '15 at 02:46 AM

thank you very much , your answer is correct , rewrote that as an answer please .

avatar image eXi Aug 06 '15 at 08:37 AM

Awesome! (: I converted the comment to an answer and accepted it for you. If you have more questions regarding this specific problem, feel free to reopen it and ask me.

(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