Trying to make a cooldown function in BPC

Hi i want to make some thing like that :

But i can’t figure how to use set Timer by Event in a function, cause i want to have and output of this function to know if i can cast or not, and i have in my UI (widget) a progress bar link to CDTimer :

So i need to know and update the value to have a nice progress bar going down.
I find that can do the trick for update based on the value but can’t figure how to make it work in the function to make it update progessively

( A look a lot of YTB and Forums but didn’t find the golden responce.

Thanks a lot in advance ! :smiley:

Hey @user_0cdc92094ccfc3a386c2e34745600d97959b20b16aec0a07afc534!

So your “Set CD timer” node… is that on tick? You will need something constantly updating, it looks like, so if it’s not on tick, it needs to be.

Can’t really use set timer by event in a function because events only live in event graph. Could try setting timer by function name, but a function won’t wait for it to finish before returning. Probably going to have to make that cd bool into a var, and check that in a branch.

Hi, I did something similar for a firing weapon system :


I am using two variables :

  • float CooldownTimer
  • bool CanShoot

You must know that the StartCooldown is a custom event so we can use the ‘delay’ node.

So, in your case you will just have to check if your boolean variable is true before calling your skill logic.

If you have any question, don’t hesitate :v:

Hi thanks that a simple solution but i ear that using the delay node is node that godd for cooldown thing ^^’

Hi, i find out that yeah i need to have this kind of func runing on event tick :

But i want to make thing clean as i can don’t know if i can pass the “Handle” value from my BPC to my wiget without creating the variable and replicated it (for multi)
Pass it like that (exemple)

(return directly to func , to avoid creating variable)

Hi, yeah but how do i check every loop or else to have a good porgress bar anim (CD Timer is link to the progress bar value (0 to 1 float))

If you promote the timer to a variable, you can check it in tick or any other function.

Thus, an ability function might look like this, only doing something more interesting than playing a rando editor sound:

(The endCooldown func called there just sets the bool back to false, the true pin is just printing “please wait” lol)

In tick event, you’d query the timer var and plug it into the same math as your update function:

Or just plug the timer var into input of a call to your update func

1 Like

Thanks that what i was looking for !

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.