while tick() - startTime < duration do local alpha = (tick() - startTime) / duration local angle = math.rad(360 * alpha) local newCF = startCF * CFrame.Angles(angle, 0, 0) rootPart.CFrame = newCF task.wait() end
UserInputService.JumpRequest:Connect(function() if not frontflipActive and humanoid.MoveDirection.Magnitude > 0 then frontflipActive = true local startCF = rootPart.CFrame local startTime = tick() local duration = 0.5 -- seconds
rootPart.CFrame = startCF * CFrame.Angles(math.rad(360), 0, 0) frontflipActive = false end end) using UnityEngine; public class Frontflip : MonoBehaviour