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 to show/hide HUD

I want to implement an ammo counter that when the player presses a key, lets say M, the ammo number will appear on the HUD for a certain period of time before dissapearing. I have attempted it, testing it out with a print, the print works but the actual drawing onto the HUD bit doesnt any ideas? alt text

Product Version: Not Selected
Tags:
more ▼

asked Jun 26 '14 at 10:23 PM in Blueprint Scripting

avatar image

LDodds
88 13 17 21

avatar image Jacky Jun 26 '14 at 10:44 PM

You need to use Event Receive Draw HUD to execute Draw Text. And if you want it to appear only when you fire the weapon, then you can use a blueprint interface with a boolean variable, set it in your character blueprint with fire event and use a branch in the HUD right before draw text.

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

3 answers: sort voted first

alt text

There is a simple way to do this

First, when press your "Show Ammo" key, open on a bool

Then remember, if you want to draw any thing on screen, you should use "Event Receive Draw HUD"

Set a branch, if "Show Ammo Number" is true, then draw a text and set a Delay depend on how long you want the text to show.

Until delay complete, close the bool. The text will disappear

Hope helpful

all.png (110.7 kB)
more ▼

answered Jul 25 '14 at 05:28 PM

avatar image

Smomo
179 13 17 33

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

Have you tried making this into a function that is called during the update tick for the hud and at the beginning of the draw adding a condition check? Anything that is skipped on the update draw tick will be erased there after. You could be causing a draw flood to happen since as u hold the key down you are issuing a draw command and could be flooding the draw event. That's one reason why it takes a while to vanish.

more ▼

answered Jun 26 '14 at 10:46 PM

avatar image

Shoiko
638 57 55 67

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

Hello here is a great tutorial on how to do this, credit goes to tesladev

https://www.youtube.com/watch?v=jWVUr-i5zaM&list=PL7OpsBgBjeGLu5eVMVuYQiEF3uuvYeiv6∈dex=2

more ▼

answered Jan 17 '15 at 07:48 AM

avatar image

Tone
26 2 3 9

(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