Hey guys, I'm a small roblox developper in learning. So, you know this animation to hold a gun?
For make the script, it's so really easy.
1 | Tool.Equipped:Connect( function () |
2 | animTrack = Humanoid:LoadAnimation(script.Parent.Hold) |
3 | animTrack:Play() |
4 | end ) |
But when I create a animation, after the end of the animation the animation stopped. But how to make it infinite? I don't want use AnimationTrack.Speed or AnimationTrack:AdjustSpeed because it's not worked.
In your animation settings set 'Looped' to true or from a script do it. The :LoadAnimation()
function returns an AnimationTrack, and that has the Looped property.
1 | AnimationTrack.Looped = true |
Another possible issue could be that the priority is too low. The lowest priority is core, whilst the highest is action. A good priority for a holding animation for a tool is movement.
1 | AnimationTrack.Priority = Enum.AnimationPriority.Movement |
Or from the animation settings, you could do this as well.