I am trying to figure out how to add a cooldown to my skill, like the skill can’t be used for another 10 sec. I am using the enable/disable input nodes now, but that disables every input I have in my controller and I want it to only disable a specific Input, but I can’t figure out how?
When you want to perform the skill you check a timer. In this example it’s called DodgeCooldown. If the timer is less then the current game time you go ahead and perform the skill. After (or before) you’ve performed the skill you update the timer to Current game time + Cooldown time. In my example I add 5 seconds which will mean 5 second cooldown on the skill.
Using the First Person Template as an example, just create a bool called “CooldownActive?” and then a branch checking to see if the condition is true. If it is, do nothing, if its not, continue down the line. Set the Cooldown Active to yes at this point, then do whatever you need like spawning an actor and then call a delay at the end of that which acts as your cooldown time (you can set this to a variable) and after the delay, set Cooldown Active to no.
Some people might say that you shouldn’t answer a boolean with false, but I think its all just in the way you name the boolean. CooldownActive? answered with False makes sense. “No, the cooldown is not active so please continue.”
A bit late, but it looks like the branch here would prevent that. (If it’s in cooldown, it would go to the True branch, and thus do nothing in the false branch, which includes turning on the cooldown.)
This doesn’t quite work. I tried using this for a weapon fire rate cool down. Like a rifle that can only fire once every 4 seconds. But when I put 4 it, the actual fire rate is noticeably slower. There is some part of this that causes a long delay that gets worse as the cooldown gets smaller
Thx it helped me add a cooldown for my fireball wich is consuming mana so i kinda just put what you posted in front of that mana consumption. It would consume mana eventhough the fireball wasnt shooting since it has a rather slow animation.