Creating a stationary backflip is no problem. Getting the player to actually jump backwards, however, has caused some difficulty.
My first attempt was to make the animation stationary and then use Velocity to move the character back. Although both the 'bump back' and the animation worked fine on their own, putting the two together caused problems. Setting the velocity of the torso caused the animation to stop mid-way through (as soon as the Velocity was changed), and not finish playing.
My second attempt was to build the movement into the animation, but this didn't work either. Animations are only created around a HumanoidRootPart, so while all the other parts of my character moved, the HumanoidRootPart did not. This caused both the camera to stay in the same position and the character to snap back to the HumanoidRootPart after the animation was finished.
Although all my code is functional, neither method worked. Do you know of a new, better one?
EDIT
Code:
local plr = game.Players.LocalPlayer repeat wait() until plr.Character local chr = plr.Character local hum = chr:WaitForChild("Humanoid") local root = chr:WaitForChild("HumanoidRootPart") local mouse = plr:GetMouse() local anim = workspace:WaitForChild("Animation") local canPlay = true mouse.KeyDown:connect(function(key) if key:lower() == "q" and canPlay then canPlay = false local animTrack = hum:LoadAnimation(anim) local bt = Instance.new("BodyThrust",root) bt.force = Vector3.new(0,0,4000) animTrack:Play() wait(0.4)--Anim. time bt:Destroy() wait(1) canPlay = true end end)
My suggestion: You may create a BodyForce inside the HumanoidRootPart, since it is stationary while the animation plays.
You can set the force of it to the HumanoidRootPart's lookVector, then negate it to get a force the opposite direction of the front face.
BodyForce.force = -(HumanoidRootPart.CFrame.lookVector * 100) -- Something like this.
This works ideally in a condition where the animation does a stationary backflip, rather than:
a tuck and have a BodyMover object/ RotVelocity/ Velocity do all the rotation work.
a backflip animation that moves the character back, excluding the HumanoidRootPart.
I hope this helps.