Good day, fellas. So I was working on an animation and I wanted it to be paused at the last frame when the key is being held down and play another animation [the release] animation when the key is released.
I did, (Just a replica of what I made, since the original one can be complex.
UIService.InputBegan:connect(function(inputKey)
if inputKey.KeyCode == Enum.KeyCode.Q then
anim = humanoid:LoadAnimation(folder["Animation"])
wait(1)
anim:AdjustSpeed(0)
end
end
I tried doing this but later realized that it's probably not a very efficient way of doing it, since I'll be doing it on several animations as well, with different time length (I was thinking the wait(1) would be changed everytime and it also feels un-optimized to me having the wait. So, detecting whether the animation is at its last keyframe, how should I do that? What event of the animation can get the length of the animation I'm playing?
I am using the Moon Animator 2 for Animating it. So, I really hope it doesn't interfere that much on this problem. What do you recommend? (Not asking for a script, rather a recommendation of a solution to this)

1 comment
More about animation functions: https://developer.roblox.com/en-us/api-reference/class/AnimationTrack