But for some reason, this does not always work and sometimes it just directly continues the animation. I’m currently trying to use a different method which involves freezing an animation at a certain timeposition. My script looks like this:
if animation.TimePosition == 0.417 then
animation:AdjustSpeed(0)
end
And yeah, the script above isn’t working. I have taken a look at other posts of similar things including the roblox article about timepositions, but I didn’t really understand clearly about how they used timeposition to freeze an animation. I heard that there are also other ways like using keyframe reached, but currently I’m using Moon Animator instead of the default animation editor so I don’t know if they can still be used.
You would have to constantly be checking in a loop if the TimePosition is equal to 0.417, which is an extremely precise number, and the loop might miss it. For example, a normal “while task.wait() do” loop runs about 30 times a second (if i remember correctly)
The loop might see the TimePosition as 0.415, then it would wait 1/30th of a second, and then the TimePosition would be 0.419. This could be your issue. What you could do is something like
repeat task.wait() until TimePosition >= 0.417
animation:AdjustSpeed(0)