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"

I want to make a death counter that is up in the corner and counts up to a million if it has tto, but resets after every level. Help?

I want to make a death counter that is up in the corner and counts up to a million if it has tto, but resets after every level. Help?

Product Version: UE 4.9
Tags:
more ▼

asked Mar 05 '16 at 06:39 PM in Using UE4

avatar image

RAG3andF3AR
6 2 3

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

1 answer: sort voted first

Here's what I would do:

  1. Add a variable to your pawn called "deaths". It should probably be an int, as you can't have half a death (I assume).

  2. Create a new widget called "HUD" (unless if you already have a HUD, in which case you should use that).

  3. Add a horizontal box to the corner of this widget's canvas panel.

  4. Place two text items in the horizontal box.

  5. Set the first text block to "Deaths: " (or whatever you want)

  6. Where the second text block has space for text to be put in, click the 'bind' button instead.

  7. Select "Create Binding"

  8. Add a "Cast to [your pawn's class]" node between the two existing nodes.

  9. Use "Get player pawn" to fulfill the "object" input.

  10. Use the "As [pawn class]" node to create a "Get Deaths" node.

  11. Drag the output from the "Get Deaths" node into the return node.

  12. To the BeginPlay event on the pawn, append a "Create Widget" node.

  13. Set the class to "HUD".

  14. Append an "Add to Viewport" node to this, using the return value from the previous node.

And that should do it! The counter should reset when you change levels automatically, unless if you found a way to preserve the pawn. You can change the names here if it is to your liking.

more ▼

answered Jan 07 '17 at 01:34 AM

avatar image

Jjman739
71 7 6 14

(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