- What do you want to achieve? Keep it simple and clear!
I wish to achieve a simple punch script that cycles through animations.
- What is the issue? Include screenshots / videos if possible!
I do not know how to make the last animation stop when the new animation is played, and this results in a wonky mess when the attacks are spammed as the ending of the previous animation will overlap with the beginning of the new one.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I did think of making the animations shorter to match the cooldown, but I wanted to keep the animations a little longer so that I could animate small details such as getting back into the idle stance and possible sword twirls, so on.
I tried implenting a simple
if track then
track:Stop()
but that did not solve anything, as I later figured each time the RemoteEvent is fired, a new track is created and it can not delete the previous one. Is there a way for me to make it possible that a new animation stops the old one, without the inconvenience of accidentally stopping ALL the players’ attack animations once a new player attacks (This is a server script)
local anim = storage.M1S[tostring(combovalue)]
local track = Humanoid.Animator:LoadAnimation(anim)
track:Play()
if combovalue >= #storage.M1S:GetChildren() then
char:SetAttribute("M1Combo", 1)
else
char:SetAttribute("M1Combo", combovalue + 1)
end
task.wait(0.5)
if debounces[plr] then
debounces[plr] = nil
end
This is the animations working properly:
And this is them once you attack continously