Animation resests objects position

I have this simple code

local LidOpenAnimation = Frame.AnimationController.Animator:LoadAnimation(Frame.Animations.OpenLid)
LidOpenAnimation:Play()

robloxapp-20241021-1733137-ezgif.com-video-to-gif-converter
It’s a simple animation
robloxapp-20241021-1734505-ezgif.com-video-to-gif-converter

2 frame keys for the lid
image

No reason for the lid to close again, I have no close animation, i dont set the lid cframe anywhere

1 Like

Because this is an opening animation, when it ends, the animation stops.
You can pretty much make it stop at the last frame like this:

local LidOpenAnimation = Frame.AnimationController.Animator:LoadAnimation(Frame.Animations.OpenLid)
LidOpenAnimation:Play()

task.wait(LidOpenAnimation.Length * 0.99)
LidOpenAnimation:AdjustSpeed(0)

Another solution, which is to make another animation of this frame:
image
and play it and keep it looped.

2 Likes