Player can't WallJump more than once

I just figured out!

Include jumping along with the freefall on the loop, like this:

while Humanoid:GetState() == Enum.HumanoidStateType.Freefall or Humanoid:GetState() == Enum.HumanoidStateType.Jumping do

Do i also add it here?

local function StateHandler(Old, New)
    if New == Enum.HumanoidStateType.Freefall then
        WallJump()
    end
end

Yes so that wall jumping can feel more responsive.

Like this, right? Just making sure

local function StateHandler(Old, New)
    if New == Enum.HumanoidStateType.Freefall or New == Enum.HumanoidStateType.Jumping then
        WallJump()
    end
end

Yes, just like with the loop. I believe this will solve your issue.

We’re so dang close, it allows the player to WallJump on another wall only when he’s in the Jumping state it seems

1 Like

Add a new variable that’s called OnAir and set it to false, like this: local OnAir = false.

Then on the StateHandler, you’ll do this:

local function StateHandler(Old, New)
    if (New == Enum.HumanoidStateType.Freefall or New == Enum.HumanoidStateType.Jumping) and not OnAir then
        OnAir = true
        WallJump()
        OnAir = false -- This is yielded due to the loop, as in, setting it to false upon landing.
    end
end

Also be aware with the magnitude check, which is:

local Distance = (Root.Position - Part.Position).Magnitude
if Distance <= 6 then
    NearWall = Part
    break
else
    NearWall = nil
end

I tested this and found out that wall jumping doesn’t work when you’re far away from the wall’s center. This can be a problem if the wall is really big. Instead do this:

for _, Part : Part in ipairs(Parts) do
    if Part:HasTag("Wall Jump") then
        NearWall = Part
        break
    else
        NearWall = nil
    end
end
1 Like

(Had to repost the comment cuz i put the wrong video) ok, so, thank u so much, it finally works. This was a pain!!!

1 Like

Glad that I could help you. Be sure to mark solution to any of my posts to let others know that the problem has been solved! :heart:

Maybe you should mark solution to the post where I figured out the problem as it helped the most. Wasn’t for that we’d have been stuck diagnosing the problem. :sweat_smile:

1 Like

Yeah, that’s a really good idea :+1:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.