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
01 | can = true |
02 |
03 | script.Parent.Parent.Chatted:Connect( function (msg) |
04 | if msg = = "KAMEHAMEHA" then |
05 | if can = = true then |
06 | can = false |
07 | script.Parent.Parent.Character.Humanoid.WalkSpeed = 0 |
08 | script.Parent.Parent.Character.Humanoid.JumpPower = 0 |
09 | local k = Instance.new( "Animation" ) |
10 | k.AnimationId = "rbxassetid://2863412692" |
11 | wait() |
12 | script.Parent.Parent.Character.Humanoid:LoadAnimation(k):Play() |
13 | wait( 5 ) --the time of animation |
14 | script.Parent.Parent.Character.Humanoid.WalkSpeed = 16 |
15 | script.Parent.Parent.Character.Humanoid.JumpPower = 50 |
16 | wait( 10 ) |
17 | can = true |
18 | end |
19 | end |
20 | 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!
1 | local humanoid = --- put you humanoid Here! |
2 |
3 | for I,AnimTrack in pairs (humanoid:GetPlayingAnimationTracks()) do ---get all the playing animation tracks! |
4 |
5 |
6 | AnimTrack:Stop() |
7 |
8 | 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
01 | repeat wait() until |
02 | animation.Playing maybe if that exists do |
03 | local humanoid = --- put you humanoid Here! |
04 |
05 | for I,AnimTrack in pairs (humanoid:GetPlayingAnimationTracks()) do ---get all the playing animation tracks! |
06 |
07 |
08 | AnimTrack:Stop() |
09 |
10 | end |
constant stop
01 | if bla bla |
02 | if sbsf bla |
03 | then do this |
04 | humanoid = script.Parent.Humanoid |
05 |
06 | for I,AnimTrack in pairs (humanoid:GetPlayingAnimationTracks()) do ---get all the playing animation tracks! |
07 |
08 |
09 | AnimTrack:Stop() |
10 |
11 | end |
12 | other animation |
13 | local humanoid = --- put you humanoid Here! |
14 |
15 | for I,AnimTrack in pairs (humanoid:GetPlayingAnimationTracks()) do ---get all the playing animation tracks! |
16 |
17 |
18 | AnimTrack:Stop() |
19 |
20 | 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:
01 | while (value) = = true do |
02 | local humanoid = --- put you humanoid Here! |
03 |
04 | for I,AnimTrack in pairs (humanoid:GetPlayingAnimationTracks()) do ---get all the playing animation tracks! |
05 |
06 |
07 | AnimTrack:Stop() |
08 |
09 | end |
10 | end |