Hello there. I’ve been trying to recreate FE2’s (Flood Escape 2) sliding mechanic. I am so close to finishing it, but there is this small bouncing that’s been bugging me so much lately. (Video might lag) https://gyazo.com/833b1ad86eb12fd05120eb00305af1d5
The function that creates the body mover:
function runSlide()
if canSlide then
canSlide = false
humanoid.PlatformStand = true
slideAnimTrack:Play(0.18)
slideSound:Play()
local gyro = Instance.new("BodyGyro")
gyro.Name = "SlideGyro"
gyro.P = 500
gyro.D = 50
gyro.MaxTorque = Vector3.new(math.huge, 2000, math.huge)
gyro.CFrame = roopart.CFrame
gyro.Parent = roopart
local velocity = Instance.new("BodyVelocity")
velocity.Name = "SlideVelocity"
velocity.MaxForce = Vector3.new(18500, 1000, 18500)
velocity.Parent = roopart
if humanoid.MoveDirection.Magnitude == 0 then
velocity.Velocity = roopart.CFrame.LookVector * humanoid.WalkSpeed
else
velocity.Velocity = humanoid.MoveDirection * humanoid.WalkSpeed
end
task.spawn(function()
task.wait(duration)
velocity:Destroy()
gyro:Destroy()
slideAnimTrack:Stop(0.13)
humanoid.PlatformStand = false
canSlide = true
end)
end
end
Any help would be very appreciated !