I’m having a strange issue with an animation track. I’m not sure I can provide much information on the issue, but I’ll give you as much as I can.
Description
Basically, I’m loading a track into the player’s humanoid (server sided, if that matters), setting Looped to true, and setting priority to Action. However, after playing the track, the track will indeed play, but after the track ends, it does not loop.
The animation itself does not involve any actual movement (it’s a still animation of both arms “holding” an object).
It plays for approx 2 seconds before the animation ends and it reverts back to the Roblox core animation.
Any ideas?
Edit: For the sake of redundancy, I re-uploaded the animation with the priority already set to action. This didn’t fix the issue.
Another side note,if I begin running while the animation is playing, the animation will be cancelled out by Roblox core animation, even though I have it set to play as an action. If I’m already running when the animation begins, it plays through just fine.
Sorry, edit. Seems like beginning to run while the track is playing actually doesn’t affect it.
Glad I could help, I think the reason it’s not working is because animations can’t be looped via script and can only be looped via the animation editor.
Essentially, the loop logic doesn’t replicate between the client/server boundaries. Playing the animation on the server will loop it on the server, same goes for the client. You can visualise it in a play solo session by toggling between both.
This shouldn’t be an issue if you set the property from the animation editor.
local humanim = hum:LoadAnimation(script:FindFirstChildOfClass("Animation")) -- Load Anim
local animtime = 4 -- The Animation Time Duration (You can look it on your Animation Editor)
--Playing Animation--
while(animtime) do -- Loop
humanim:Play() -- We play the animation
wait(animtime) -- every animends we stop the anim and this starts again
humanim:Stop() -- We stop de anim for safety
end