I have a slide mechanic, it applies an impulse, and the impulse works, but well;
the impulse pretty much gets negated instantly, because the legs have friction
so i have 3 solutions:
- make legs non collidable during the slide
- remove leg friction
- use linear velocity so the force is constant and won’t get interrupted
function groundMovement:Slide(character: Model)
local rootPart: BasePart = character:FindFirstChild("HumanoidRootPart")
local head: BasePart = character:FindFirstChild("Head")
local humanoid: Humanoid = character:FindFirstChild("Humanoid")
local animator: Animator = humanoid:FindFirstChild("Animator")
local characterAnimations: Folder = character:FindFirstChild("Animations")
local slideAnim: Animator = characterAnimations:FindFirstChild("Slide")
local characterSounds: Folder = character:FindFirstChild("Sounds")
local slideSound: Sound = characterSounds:FindFirstChild("Slide")
local fakeCameraPartSize = Vector3.new(1,1,1)
local fakeCameraPart = utility:CreatePart(fakeCameraPartSize, 1)
local impulseDirection = rootPart.CFrame.LookVector.Unit
local impulseStrength = 800
local effectPercentage = 1.15
local slideTrack = animator:LoadAnimation(slideAnim)
rootPart:ApplyImpulse(impulseDirection * impulseStrength)
utility:GetViewmodelAndAnimate(character, "Slide")
utility:ApplyFovEffect(effectPercentage)
slideTrack:Play()
slideSound:Play()
end