I want to make a wall jump system which the player has touch the wall and face the sides or the back of the character.
I can get how to check if the guy is touching the wall, but I don’t get how to check which side the character of the player is touching.
For now I used raycast before to achieve this, but I think this is this is not a good way.
while true do
local humanoidState = humanoid:GetState()
humanoid.Touched:Connect(function(Ispart)
if (Ispart:IsA("Part") and fallCheck()) then
print("is falling")
-- Creating a Ray for ground detection
local origin = character.HumanoidRootPart.Position
local direction = Vector3.new(0, -4, 0) -- Ray goes down
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude
params.FilterDescendantsInstances = {character}
local raycastResult = workspace:Raycast(origin, direction, params)
task.wait(0.4)
if raycastResult and raycastResult.Instance then
print("cant climb", Ispart.Name)
else
print("can climb", Ispart.Name)
end
end
end)
task.wait()
end