Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to stop animation at the end?

Asked by 5 years ago

When animation plays, the body goes back to its initial position. How do I make it so it keeps its position at the end of the animation? Thank you :D

1 answer

Log in to vote
0
Answered by
mattscy 3725 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

When you set an AnimationTrack's speed to 0, it will freeze the animation at that moment. So, if you wait until the end of the animation and do this, it should hold its position.

You can try this first:

AnimTrack:Play()
wait(AnimTrack.Length)
AnimTrack:AdjustSpeed(0)

But if the animation finishes before it has time to freeze, you can try slightly reducing the wait time:

AnimTrack:Play()
wait(AnimTrack.Length - 0.1)
AnimTrack:AdjustSpeed(0)
0
Thankss xxXTimeXxx 101 — 5y
Ad

Answer this question