#clicking in an even rhythm
1 messages · Page 1 of 1 (latest)
Like this?
Yes exactly that
I set up a timer after the attack animation plays to set a bool to true then to false
If the next attack is played while that variable is true, it will play the sound and special effects
any idea on how i would go about tracking if the player clicked within an even timing between each attack?
Same way you triggered the attack
Only this time check if the bool is true or not
use ticks
You could alternatively put animation markers in the animation
I can use os.clock instead right
No animations yet just trying to get the system down
Yep same shit more or less
If I was on my PC I'd type you something
Maybe soon
--debounce not needed but good measure
local coolDown = 0.5 --seconds
local lastAction = 0 --needed for first time use
local function testCoolDown()
--if our action is faster than our cooldown, return end.
if os.clock() - lastAction < coolDown then return end
if whateverInput then
lastAction = os.clock() --update our current use in seconds
--do action here
end
end
@waxen sphinx