Hello, i am making a game where these key shortcuts use animations, but they get interupted by the default idle animation, i tried, i cant do it, i want to take it out so it doesnt inturrupt my animations like it sometimes does. Actually, i have tried when the key is pressed then it takes out the animate sccript in character and puts back in after animstion finished, but it SOMEHOW STILL DID THE IDLE THING WHERE ARMS MOVE FORWARD A LITTLE AND BACK! Please help! thanks :) Iv tried
can = true script.Parent.Parent.Chatted:Connect(function(msg) if msg == "KAMEHAMEHA" then if can == true then can = false script.Parent.Parent.Character.Humanoid.WalkSpeed = 0 script.Parent.Parent.Character.Humanoid.JumpPower = 0 local k = Instance.new("Animation") k.AnimationId = "rbxassetid://2863412692" wait() script.Parent.Parent.Character.Humanoid:LoadAnimation(k):Play() wait(5)--the time of animation script.Parent.Parent.Character.Humanoid.WalkSpeed = 16 script.Parent.Parent.Character.Humanoid.JumpPower = 50 wait(10) can = true end end end)
So this all works, its just that sometimes when the animation plays, then the idle animation with slightly moving arms interups! halp plesss!
Im not to sure what you are coming at in this question, but I will still try to make a solution out of it!
usally to stop all animations it would be like this!
local humanoid = --- put you humanoid Here! for I,AnimTrack in pairs(humanoid:GetPlayingAnimationTracks()) do---get all the playing animation tracks! AnimTrack:Stop() end
that's an example of stop all tracks!
Hello, so as Tizzel40 said about the script, that stops tracks playing, as you said sir, they stop the current ones and that DOES happen. So think, is you dont want it, can oyu make a script that detects a track starting to play? just do it with the specific track, or if not, constantly stop all tracks until all of what your script does is over :) hope this helps!
Detect
repeat wait() until animation.Playing maybe if that exists do local humanoid = --- put you humanoid Here! for I,AnimTrack in pairs(humanoid:GetPlayingAnimationTracks()) do---get all the playing animation tracks! AnimTrack:Stop() end
constant stop
if bla bla if sbsf bla then do this humanoid = script.Parent.Humanoid for I,AnimTrack in pairs(humanoid:GetPlayingAnimationTracks()) do---get all the playing animation tracks! AnimTrack:Stop() end other animation local humanoid = --- put you humanoid Here! for I,AnimTrack in pairs(humanoid:GetPlayingAnimationTracks()) do---get all the playing animation tracks! AnimTrack:Stop() end
or set an actual number variable and make it true when script starts and make other script that detects when its true and constantly stops tracks, easy to do:
while (value)== true do local humanoid = --- put you humanoid Here! for I,AnimTrack in pairs(humanoid:GetPlayingAnimationTracks()) do---get all the playing animation tracks! AnimTrack:Stop() end end