Hey there :)) A pal helped me with a wall jumping script, but it’s not the best rn. Wall jumping is supposed to be like the extension of your arm, a smooth, natural feeling mechanic. But currently, it requires some effort to succesfully perform that action. I’m going to leave the script here, feel free to test it out. Hoping for feedback on how to smoothen the mechanic!
local uis = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local character = plr.Character or plr.CharacterAdded:Wait()
local hum = character:WaitForChild("Humanoid")
local humroot = character:WaitForChild("HumanoidRootPart")
local deb = false
local function raycast()
local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.Exclude
raycastParams.FilterDescendantsInstances = {character}
local raycastOrigin = humroot.Position
local raycastDistance = 5 -- Distance for detection
local raycastDirections = {
humroot.CFrame.LookVector, -- Forward
humroot.CFrame.RightVector, -- Right
-humroot.CFrame.RightVector, -- Left
-humroot.CFrame.LookVector -- Backward
}
local raycastHit = nil
for _, direction in ipairs(raycastDirections) do
raycastHit = workspace:Raycast(raycastOrigin, direction * raycastDistance, raycastParams)
if raycastHit then
break
end
end
if raycastHit and hum:GetState() == Enum.HumanoidStateType.Freefall and not deb then
deb = true
hum:ChangeState(Enum.HumanoidStateType.Jumping)
local ejectionDirection = (humroot.CFrame.Position - raycastHit.Position).Unit + Vector3.new(0, 1, 0)
local bodVelocity = Instance.new("BodyVelocity", humroot)
bodVelocity.Velocity = ejectionDirection * 25
bodVelocity.MaxForce = Vector3.new(100000, 100000, 100000)
bodVelocity.P = 1250
wait(0.2)
bodVelocity:Destroy()
wait(0.1)
deb = false
end
end
uis.JumpRequest:Connect(raycast)