#How do i use debounce to delay my animation input detection scripts from all playing at the sametime
51 messages · Page 1 of 1 (latest)
you didnt do the "if debounce == false then"
think of it as a on off switch, you first are setting it false (line 9) then you need to make sure it's off before turning it on, (if debounce == false then debounce = true) then after the function set it back to false, because you cant turn the switch on if its already on (debounce = false)
remove line 23, you already referenced it in line 9
i always see ppl use debounce
but tbh is much easier to use cooldown
its just a change of the variable name
but your brain will intepret it better
so local cooldown = false
if cooldown then return end
-- then you set start the cooldown
cooldown = true
task.wait(2) -- this is not prefered ig you should use task.spawn or task.delay(task.delay is much easier to understand since the parameter is just: task.delay(time, function() end)
holdup
i remember you
arent you the first person i talk to in this server 🥶
no idea
when did you join
wait i can see
yeah i cant remember that far back 
this is using debounce, i never used cooldown before so idk which is better (but considering its just the name change i dont think they're any different)
local debounce = false
UIS. InputEnded: Connect(function(I,E)
if debounce == false then debounce = true
if E then return end
for _, playingTrack in animator:GetPlayingAnimationTracks() do
playingTrack:Stop(0)
abilitytrack.Looped = false
end
abilitytrack:Play()
task.delay(1, function()
debounce = false
end)
print("punch")
game.ReplicatedStorage.RemoteEvent:FireServer()
end
end)
understandable?
yeah there's no difference lol
its just your brain intepret cooldown faster because its a more common word
debounce and cooldown isnt entirely the same
debounce is global cooldown to all moves
cooldown can be for each skill
wym
How is it global if I put it in one script

global is a variable that can be accessed by code in the same script, not all scripts
correct me if im wrong idkk mann
wait so this can be confusing because as this guy said [image]
oh
TY
wrong 💀
oh never mind
i thought you said _G-
IT IS THE SAME ITS JUST A NAME-
bro what the
cooldown is a bool
and debounce is a bool right
aren't they the same thing only different by name
do bools do different things by name
my anims are still playing all at once
YEAH THATS WHAT I SAID-
script error duh
I don’t have any errors
This value thingy is an error though
exactly