- What do you want to achieve? Keep it simple and clear!
I want to create a sliding system for my movement system. - What is the issue? Include screenshots / videos if possible!
When I slide in third person, the player spins around a bit, and even in first person it spins just a little before realigning - What solutions have you tried so far? Did you look for solutions on the Creator Hub?
I’ve tried looking on devforum but nobody has my problem
My velocity function:
local function Velocity(VectorVelocity, Part)
local LinearVelocity = Instance.new("LinearVelocity")
local Atch = Instance.new("Attachment")
Atch.Parent = Part
LinearVelocity.RelativeTo = Enum.ActuatorRelativeTo.World
LinearVelocity.VectorVelocity = VectorVelocity
LinearVelocity.MaxForce = math.huge
LinearVelocity.Attachment0 = Atch
LinearVelocity.Parent = Atch
return LinearVelocity, Atch
end
and my slide function:
local function Slide()
if not IsRunning then return end
IsSliding = true
if Hum.FloorMaterial == Enum.Material.Air then
repeat task.wait() until Hum.FloorMaterial ~= Enum.Material.Air or not IsSliding
end
local CurrentSpeed = Info.Slide.SlideSpeed
LinearVelocity, Atch = Velocity(HRP.CFrame.LookVector*CurrentSpeed, HRP)
PlayAnim("Slide", 0.3)
repeat
CurrentSpeed *= 0.95
LinearVelocity.VectorVelocity = HRP.CFrame.LookVector*CurrentSpeed
task.wait(0.08)
until not IsSliding
end
thanks ![]()