Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my animation only playing once, even thought it should work multiple times?

Asked by 3 years ago

Heres the code for the animation

local biteanim = Instance.new("Animation")
biteanim.AnimationId = "rbxassetid://5638379797"
local biteanimTrack = humanoid:LoadAnimation(biteanim)

and heres the code when I play it in the function

biteanimTrack:Play()
wait(1)
biteanimTrack:Stop()

it plays once when the game starts and doesnt play again

0
if it helps any, the function uses player:LoadCharacter() a few times xXSwegL1feXx 0 — 3y
0
do you want it to loop? or do you want it to just play a few times packayee 13 — 3y
0
you can get animations to play? Jakob_Cashy 79 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

If you want the animation just to play a few times, not loop, you can do:

biteanimTrack:Play()
biteanimTrack.Looped = true

wait(put how long you want the animation to last in seconds here)

biteanimTrack.Looped = false
biteanimTrack:Stop()

If you want the animation to loop then use:

biteanimTrack.Looped = true
biteanimTrack:Play()
Ad

Answer this question