ISSUE
as you can see from the video included, whenever I use the ability I made, I change the players walk animation and walk speed for a certain duration and then return both properties back to normal however… The animation doesn’t stop showing until I perform another animation like jumping or going idle.
ATTEMPTED SOLUTIONS
I’ve tried different approaches on handling player animation like Humanoid:LoadAnimation()
and I’ve also tried implementing Humanoid:GetPlayingAnimationTracks()
inside of a for loop and stopping every animation through it but neither seem to work or give me any errors.
CODE
here is the few and only lines of code that handle changing the players walk animations and walk speed:
--[ CHECKS FOR THE HUMANOID, SLOWS CHARACTER AND CHANGES ANIMATIONS ]--
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
humanoid.WalkSpeed = 8
character.Animate.walk.WalkAnim.AnimationId = "rbxassetid://16635380307"
character.Animate.run.RunAnim.AnimationId = "rbxassetid://16635380307"
end
--[ HANDLE THE ABILITY SFX, *IGNORE THIS* ]--
task.wait(abilityModule.abilityData.Instinct.Duration)
instinctHighlight:Destroy()
instinctWoosh:Destroy()
instinctAftersound:Destroy()
--[ SETS WALKSPEED AND ANIMATIONS BACK TO ORIGINAL ]--
humanoid.WalkSpeed = 16
character.Animate.walk.WalkAnim.AnimationId = "rbxassetid://16460301108"
character.Animate.run.RunAnim.AnimationId = "rbxassetid://16460301108"