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 set up a counting up timer when I enter a trigger box and a trigger box at the end of the level that stops the timer?

Also another issue I have is that I have no idea how to register the play time between the trigger boxes so the time would be displayed at the levels end screen and saved in a scoreboard widget?

Product Version: UE 4.19
Tags:
more ▼

asked May 13 '18 at 04:36 PM in Using UE4

avatar image

paula55
5 1 4

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

1 answer: sort voted first

you can do this pretty easily by getting the game time. if you want to get the time between two points all you have to do is get the game time at the start point then subtract it from the game time at the end point. alternatively you could use the get game time since creation which is based on how long an actor has exited in the world. these node are affected by time dilation and pausing the game just so you know. below i posted a little script that when the player overlaps a trigger box it prints the time as an example.

alt text

capture.png (129.6 kB)
more ▼

answered May 13 '18 at 04:59 PM

avatar image

ThompsonN13
10.1k 33 10 23

avatar image paula55 May 13 '18 at 05:27 PM

But how can I display the time on the screen afterwards? And how can I save it to a score board?

avatar image ThompsonN13 May 13 '18 at 05:45 PM

it really depends on the situation, but you could easily add that information to a widget. just make a widget and have a variable in the widget, then when you create the widget just set the variable to the time value that you want.

in the example below i made a widget named time that had a text component, the text was bound to the value of a float variable also named time (had to make it confusing right). then on overlap with the trigger i create the widget, set the value of the variable, then add the widget to the viewport. oh and for testing purposes i also made it destroy itself after a few seconds.

alt text

capture.png (148.0 kB)
avatar image paula55 May 13 '18 at 09:18 PM

Thank you!

(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