Slope Slide Issue

So at certain high speeds, when jumping up and into a slope, this will occur:
RobloxStudioBeta_z18V2MYkfy

(At the end is most noticeable)
The character will be stuck in freefall and will begin to slide across the slope rather than returning to a normal running state, sometimes also resulting in the character to be flung up oddly against the slope.

Anyway to stop this issue without making the character halt to a complete stop?

It happens because the humanoid cannot “land” on a surface while moving upward. I don’t know how to change animations but if you do, you could make the walk animation depend only on if there’s surface below the character and they are moving horizontally, and not count whether they are “landed” according to the Humanoid.

It is not an animation issue as even disabling animations and having it be a stiff character still leads to the issue. It inconsistently enters the landing state when getting back onto the slope from jumping on or from the slope, hence resulting in the character to slide off awkwardly while not being able to move up at all (it stops the character from moving up since it thinks the character is freefalling still).

This is simply just how roblox operates my guy. The best way to make it not seem like you’re free falling is to make a camera changing script, depending on what angle you’re at to stop the free fall. Animation could work for this, but it’d be out of place, so the camera script might work better for ya.

So anyways after a little bit of digging and a bunch of prints, I’ve concluded the issue is mainly the character getting stuck below their hipheight.

You can find this out by getting in the same issue (run into slope fast with jump and witness slide).
Cast a raycast beneath the player and get the position of it, subtract the difference with the rootpart position (y values). If the value is lower than the hipheight of the humanoid , sliding will occur. If the value is above the given hip height, sliding will probably not occur.

To further make this better and avoid any false positives, I gave a 0.1 leeway of checking so that it mostly only fires whenever the issue occurs. I also check if the normal isnt 0, 1, 0 (flat) so that I know its happening on a slope and that the character is moving (move direction is not 0,0,0).

Once I’ve verified that it is indeed occuring, I apply an impulse on the rootpart to push the player up just so slightly that the player gets “unstuck” from the position. At the same time, im changing the humanoidstate to “Running” so that it switches the state completely from freefalling.

RobloxStudioBeta_XxbGGqVoRl

image

(When it is printing “BOOOM” (yes ik im lazy with prints), it fires the event and counteracts the issue immediately. This is being done on the client.)

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