How could I get it so that, when the player touches a trigger, digits are displayed at the top of the screen in a stopwatch manner, going up? And then stopping when another trigger is pressed?
Thanks!
How could I get it so that, when the player touches a trigger, digits are displayed at the top of the screen in a stopwatch manner, going up? And then stopping when another trigger is pressed?
Thanks!
Here is a very basic way in the character bp:
bool -> with the bool you turn the timer on/off. You can also do that with a trigger in another bp. Then you just have to cast to your character bp.
integer -> the time which will be increase with the “int+int” node
delay -> decreases the event tick to 1 second
print string -> prints the numbers on the screen
branch -> is connected with the bool. There it gets turned off and on
1 -> when I press 1 it gets activated (counts up) and when I release it it will stop
To get a more “fancy” effect you can also use UMG -> therefore watch some UMG tutorials on youtube
OH cool thanks I can use this for other things
Thanks, now that it is working, how can I get the count to go on automatically from when I touch 1 trigger to when I touch the other without me having to hold down the 1 button?
As I mentioned, you will have to create a “trigger bp” which will activate/deactivate the bool. -> I will post a picture in some minutes
Thank you.
Why not simply use timers?
That’s also a way
@Noahdutch
That’s how you can turn it on/off with a trigger:
This is used instead of the part with the “1” key. It was made in a actor bp
Thanks, but how do I get Cast to MyCharacter and Set Timer On Off? Also, I can only make an OnActorBeginOverlap from my trigger actor and it only has the Other Actor thing, not the Other Comp or any of the others.
You have to add the "get player character " node - drag the link from “Return value” out - type in “mycharacter” (or the name of the bp that includes the timer part) - coose cast to…
For the trigger I have just created a new actor blueprint.
Then I added a box volume in the component tab
Now in the component tab in the properties you can create an event out of it -> oncomponent begin overlap
After that it should jump into the event graph
Now add the nodes on the picture
What about the SET timer on and off node?
Thanks for being patient with me, I am very new to this blueprint thing.
Drag out the “As My Character” link from the cast - type in the name of your bool that you have created in the mycharacter bp;)
Thank you. It works.
Now what about stopping the time by touching another trigger but keeping the text there?
Also, how can I make the digits be constant (not multiple appearing on the screen 1 by 1) and have decimal points included, like a real stopwatch?