How to make the player move with the animation?

When I use my animation, it’s supposed to make the player jump over an object, but when I execute the animation, when the animation is finished playing it sends the player back to the starting point of the animation and the players camera doesn’t move with the animation. Any idea how I can make the actual player move with an animation so it doesn’t reset back to how the animation begins?

The solution is Root Motion but Roblox does not have that feature yet. But there is a little work around using this code:

Character.HumanoidRootPart.Anchored = true -- Optional but recommended
AnimationTrack:Play()
AnimationTrack:GetMarkerReachedSignal("End"):Wait()
AnimationTrack:AdjustSpeed(0)
Character.HumanoidRootPart.CFrame = Character.Torso.CFrame
AnimationTrack:Stop(0)
Character.HumanoidRootPart.Anchored = false -- Optional but recommended

NOTE: The End animation marker/event needs to be placed a good couple of keyframes before the animation completely stops.

This works just fine but is quite noticeable when the framerate is low or if ran on the server.

I hope this helps!

4 Likes

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