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"

How can I make a HUD collectible item counter? Can print to screen, but not to HUD.

I managed to make the game count the items collected (here I call them Life) and print the number to screen. However, I want to have it add the number to a HUD.

this is what I have in the Life actor blueprint (the adding function) https://i.gyazo.com/66f1e3beeb9c4511757402043b7a4e35.png

this is what's on the pawn character blueprint https://i.gyazo.com/899d73ab34674f90af9fa2bbf91636ae.png

this is the event graph for the HUD https://i.gyazo.com/87da83f40f69dccfea0dcb35387bb20d.png

and something I tried to do to get it to read the variable and bind it to an empty text box on the HUD (it doesn't work) https://i.gyazo.com/d12e1a96fdc9f2ce6db05b9b4005c185.png

Any help is really appreciated! I'm pretty new to this and can't figure it out. Thanks! welp

PS. If you know how to stop the counter from resetting every time I leave the level, and come back in, please share as well, it would really help.

Product Version: UE 4.15
Tags:
more ▼

asked May 12 '17 at 10:17 PM in Blueprint Scripting

avatar image

Keop1
3 1 2

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

1 answer: sort voted first

It would probably be more efficient to handle the variable stuff in the pawn's BP.

As far as printing to your HUD goes, change the binding to a new variable (i.e. Life) in the widget, and during the tick even cast to the pawn and set the widget's Life variable to the pawn's variable. I've personally only ever had problems with binding functions on widgets.

more ▼

answered May 13 '17 at 03:45 AM

avatar image

palvand
62 1 4 5

avatar image Keop1 May 13 '17 at 04:03 AM

you are a beautiful human being! haha thank you so much, this worked. Just in case, any idea on how to stop it from resetting?

avatar image Keop1 May 13 '17 at 04:37 AM

oh nvm! I managed to use Game Instance to stop it from resetting.

(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