Heyo currently trying to make a wall jump/wall slide system like the ones in mario games however I’m a bit stuck I kind of have no idea what I’m doing. I’ve reused a wall climbing script and I’ve been adjusting things to get it the way I want, but it’s a bit buggy.
local Face = nil --not sure what this does in the script
local Params = RaycastParams.new()
Params.CollisionGroup = ("Climbable")
Params.FilterDescendantsInstances = {Character}
Params.FilterType = Enum.RaycastFilterType.Blacklist
Params.IgnoreWater = true
local BV = Instance.new("BodyVelocity")
BV.Name = "WallClimbBV"
BV.MaxForce = Vector3.new(4000,2500,4000) --seems to be a good force to be affected by gravity still
BV.P = math.huge
BV.Velocity = Vector3.new()
--BV.Name = ("Climb Speed")
local BG = Instance.new("BodyGyro")
BG.Name = "WallClimbBG"
BG.CFrame = CFrame.new()
BG.D = 100
BG.MaxTorque = Vector3.new(1,1,1)*math.huge
BG.P = 3000
HRP.Touched:Connect(function(Hit)
print("TOUCHED")
local Face = nil
if not Debounces["Climbing"] then
--warn("START WALL CLIMB")
local Origin = HRP.Position
local Direction = HRP.CFrame.LookVector
local Result = workspace:Raycast(Origin, Direction, Params)
if Result then
Debounces["Climbing"] = true
_G[Player.Name]:PlayAnimation("WallJump")
--HRP.CFrame = CFrame.new(HRP.CFrame.p, Vector3.new(HRP.Position.X - Result.Normal.X, HRP.Position.Y, HRP.Position.Z - Result.Normal.Z))
HRP.CFrame = CFrame.new(HRP.CFrame.p)* CFrame.fromEulerAnglesXYZ(0, math.rad(20), 0)
Face = CFrame.new(Result.Position+Result.Normal, Result.Position)
Humanoid.AutoRotate=false
Humanoid.PlatformStand=true
BV.Parent=HRP
BG.Parent=HRP
repeat
RunService.RenderStepped:Wait()
BG.CFrame=Face or CFrame.new()
if HRP.Position.Y > Result.Instance.Size.Y+3 or (HRP.Position.Y <= (Result.Instance.Position * CFrame.new(0,-Result.Instance.Size.Y/2,0)).p) then
Debounces["Climbing"] = false
_G[Player.Name]:StopAnimation("WallJump")
BG.Parent=nil
BV.Parent=nil
Face=nil
end
until (not Debounces["Climbing"])
Humanoid.AutoRotate=true
Humanoid.PlatformStand=false
end
end
end)
I’m mostly stuck with this part at the moment
--When you reach the top of the part
if HRP.Position.Y > Result.Instance.Size.Y+3 or (HRP.Position.Y <= (Result.Instance.Position * CFrame.new(0,-Result.Instance.Size.Y/2,0)).p) then
Debounces["Climbing"] = false
_G[Player.Name]:StopAnimation("WallJump")
BG.Parent=nil
BV.Parent=nil
Face=nil
end
I’m trying to make it so when the player is above or below the part I want them to stop sliding on it