I’m making it where a character in my game has a heal button but I don’t want them to spam it so how do I add cooldown? or can i
attach a game overlay to a trigger loop and then back to the game overlay.
Use counters and properties;
It starts at a certain time, but a trigger clock constantly counts down every tick, then when it reaches zero, the property updates and the cooldown deactivates.
how do I make a trigger clock
It’s a trigger with repeater code repeating itself with a start and finish gateway.
Simple.
Place down an overlay (button), it should be your special ability.
then, make it transmit on “overlay pressed” when you pressed the button
thirdly, make it deactivate when it received on channel “overlay pressed”
for your cool down: place down a wire repeater, make it have a delay of 15.0 (second)
then wires them together as shown:
Overlay (pressed) → Wire Repeater (repeat the pulse)
Wire Repeater (repeated pulse) → Overlay (Show overlay)
how do it work:
after you pressed the overlay, it will hide itself and trigger the delay of the Wire Repeater;
after 15 seconds, the delay reached itself and will show the overlay again.