Delay Node vs not precise subtraction loop

It’s only a visual cooldown.

I did something like Branch (False) → Delay 2s → bool (True) = skill ready to use again.
The loop is subtracting 0.1 every 0.1s (100ms) from the variable (2). So it should take 2s to get the variable down to 0. But when the Text says 0.4s the skill is ready to use, this “bug?” is even higher while doing this with -0.01 each 0.01s (10ms). Will result a difference with about 1.3s showing(text) and the skill is ready to use.

So the Delay node works precisely but this loop don’t, so how do i make a text to show the precise time like in the delay node?
I want to display the countdown of my ability till its ready to use for example a countdown from 3.7s down to 0.

Could you show a screenshot of the loop and branch(es)?

An alternate technique which gets rid of the many uncertainties inherent in Delay nodes, would be to set up a separate Timer event that’s NOT in a loop, to both decrement the cooldown time and check if it’s reached zero.

Delays inside of a loop are almost always a bad idea, creates uncertain operation, or so I hear.

Your loop doesn’t know how much time has passed, so of course the displayed nubmer is wrong.

You could use ‘Event Tick’ and subtract the ‘deltaTime’ from your display-variable each frame the bool is false instead, and set your variable 0 when the bool is true. Of course this will result in your variable being updated every frame, even if it stays 0 all the time.

I’ve added a screenshot.

I’ve added a screenshot.

  1. You haven’t shown anything where a “text” would update or even be displayed to the player for a cool down. That is a widget that needs a text variable to be modified.
  2. A delay of 0.01 is pointless, you might as well not even have the delay in there
  3. A timer or timeline would be appropriate to use here and every 0.1 seconds you could add/subtract 0.1 from the variable and update a text in a widget to display that info.
  4. Screen shot how this boolean is getting set and reset

You forgot that all these functions (branch, set, subtract, …) have execution times that play into the equation.

I would still recommend you to use Event Tick and just subtract DeltaTime each frame the skill is not ready.

Here is one possible set-up for you. It is generic and I use a “health meter” but it is no different from any other progress bar. I ran this off a timeline and used “0.1” as a float to add each frame so the progress bar fills nice and smooth. Depending on how long you want this to take you will have to do the math to figure out what to “add” to your progress bar variable. As for displaying this variable to the screen if you need help with that part to let me know.


242181-
][5]

Read the description, i’m not talking about the "You haven’t shown anything where a “text”. I know how to show the text and luckly there was someone who understands questions.

My mistake on the “text” comment. My other 3 points were valid though. Everyone goes about things in different ways and thinks about problems a little differently. I wasn’t trying to be rude, I was just trying to understand your problem so I could help. Without sitting in front of your computer and being able to sift through all your stuff can make answering some questions challenging. I am happy someone was able to understand what you wanted without more info. However, making comments about how lucky you are that someone who “understands questions” was around I don’t think helps these threads. Regardless, you got an answer, no hard feelings but let’s try and keep things peaceful here.