Does anyone know why my sliding system is doing this?
Heres the script (slide speed is 75 btw)
local function onTouched(other)
local character = other.Parent
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid and humanoid.FloorMaterial ~= Enum.Material.Air then
isSliding = true
--humanoid.PlatformStand = true
--slideSound:Play()
local torso = character:FindFirstChild("HumanoidRootPart")
-- Only apply the BodyVelocity once when the player first starts sliding
if not torso:FindFirstChild("SlideBodyVelocity") then
loadslideanim:Play()
local slideDirection = slidePart.CFrame.LookVector
local bodyVelocity = Instance.new("BodyVelocity", torso)
bodyVelocity.Name = "SlideBodyVelocity"
bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bodyVelocity.Velocity = slideDirection * slideSpeed
end
end
end
slidePart.Touched:Connect(onTouched)
-- Function to start the sliding behavior when the player touches the slide part
local function onTouched(other)
local character = other.Parent
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid and humanoid.FloorMaterial ~= Enum.Material.Air then
isSliding = true
--humanoid.PlatformStand = true
--slideSound:Play()
local torso = character:FindFirstChild("HumanoidRootPart")
-- Only apply the BodyVelocity once when the player first starts sliding
if not torso:FindFirstChild("SlideBodyVelocity") then
loadslideanim:Play()
local slideDirection = slidePart.CFrame.LookVector
local bodyVelocity = Instance.new("BodyVelocity", torso)
bodyVelocity.Name = "SlideBodyVelocity"
bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bodyVelocity.Velocity = torso.CFrame.lookVector * slideSpeed
end
end
end
slidePart.Touched:Connect(onTouched)
In your second script your setting the velocity property of body velocity equal to lookvector of humanoidrootpart multiplied by slide speed. Maybe set velocity of body velocity equal to lookvector of the part your slideing on multiplied by the slide speed?
what about setting the friction lower? You can do this by selecting a part, going to properties, then going to part, checking CustomPhysicalProperties, then setting friction to desired amount
Perhaps the running/climbing animations interfere with the slideing animation when interacting with the slope. Not experienced in animations just a guess.