Guest422349
(Guest 422349)
February 17, 2024, 6:33pm
#1
Hello! I am making a slide system but when I get close to a wall, the players legs get stuck inside it.
How do I fix this?
code:
Character.Humanoid.HipHeight = -2
print("sliding")
IsSliding = true
CurrentSlidingTrack = Humanoid:LoadAnimation(SlideAnim)
SmokeParticles = script.Smoke:Clone()
SmokeParticles.Parent = Torso
HumanoidRootPart.CanCollide = false
Character.Head.CanCollide = false
BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.Parent = Character.HumanoidRootPart
SlideSound:Play()
CurrentSlidingTrack:AdjustSpeed(2)
CurrentSlidingTrack:Play()
timer = 0.25
deltaTime = 0
if Humanoid.MoveDirection.X == 0 and Humanoid.MoveDirection.Y == 0 and Humanoid.MoveDirection.Z == 0 then
BodyVelocity.Velocity = Character.HumanoidRootPart.CFrame.lookVector * 23
else
BodyVelocity.Velocity = Humanoid.MoveDirection * 23
end
coroutine.wrap(SetHeight)()
repeat wait()
BodyVelocity.MaxForce = Vector3.new(Humanoid.WalkSpeed / 16, 0, Humanoid.WalkSpeed / 16) * 30000
timer -= deltaTime
game:GetService("RunService").Heartbeat:Connect(function(delta)
deltaTime = delta
end)
until timer <= 0 or EPressed == false
if IsSliding then
StopSliding()
end
1 Like
Doomcolp
(dxxmed)
February 17, 2024, 6:41pm
#2
Maybe move their character down on the y-axis (-y)?
1 Like
Guest422349
(Guest 422349)
February 17, 2024, 6:52pm
#3
Then they would be able to clip thru floors in certain cases.
2 Likes
Doomcolp
(dxxmed)
February 17, 2024, 6:59pm
#4
Hmm uhhh there’s no other logical solutions I can think of. Have you tried making the slide gap larger and seen if it works?
Guest422349
(Guest 422349)
February 17, 2024, 7:00pm
#5
Ehhhh won’t people be able to walk thru then?
Doomcolp
(dxxmed)
February 17, 2024, 7:01pm
#6
Like I guess you could set a certain character height and keep trying until you find the right height so that they can slide but cant jst walk on thru
Guest422349
(Guest 422349)
February 17, 2024, 7:03pm
#7
nvm setting the torso to cancollide false worked, thanks for trying to help tho.
StievieG
(A_R)
February 17, 2024, 7:05pm
#8
Incase this ever gives any problems, I think lowering the hipheight would be a good alternative.
(Humanoid.HipHeight)
edit: I noticed you are already lowering the hipheight in your script, you can try lowering it even further because in your video it looks like it is still slightly too high.
Guest422349
(Guest 422349)
February 17, 2024, 7:12pm
#10
like i said, setting the torso to be cancollide false worked.
system
(system)
Closed
March 2, 2024, 7:12pm
#11
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.