Make animator stop looping

Hello, I’ve been having a problem with loading animations in roblox, I’ve heard that :LoadAnimation() is deprecated so I’m instead using the Animator block. This works pretty well for me but there’s just one problem, It loops over and over, I would like to know if there is a way to stop it from doing this or another way to load animations.

Here is what I’m using to load animations, currently.

local Controller = script.Parent.Humanoid
local Animator = script.Parent.Humanoid.Animator

Animator.Parent = Controller
local Animation = Animator:LoadAnimation(script.Animation)
Animation:Play()

You are able to Manipulate the AnimationTrack

local AnimationTrack = Animator:LoadAnimation(script.Animation) -- returns "AnimationTrack"

AnimationTrack.Looped = false -- Can Loop
AnimationTrack.Priority = Enum.AnimationPriority.Action -- Animation Priority

AnimationTrack:Play()
1 Like

Maybe it’s because in the animation editor you put the repeat activated or otherwise:

local AnimationTrack = Animator:LoadAnimation(script.Animation) -- returns "AnimationTrack"

AnimationTrack.Looped = false -- Can Loop
AnimationTrack.Priority = Enum.AnimationPriority.Action -- Animation Priority

AnimationTrack:Play()
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.