Prevent Capsule To Snap To Ground When Walking?

Hi, i haven’t seen a proper answer to this and i don’t know if this is implemented yet but i’ve came across an annoying thing regarding the capsule component. When walking/stepping over surfaces greater than 0 degrees snaps to the ground, without any smooth approach. I’ve tried something on my own and plugged it in the tick event, but failed to achieve anything. Looking forward to your replies!

Go into your Character Movement settings in try tweaking the “max step height” variable.

It is not that i can’t step on a higher surface, i can but it snaps to it, there isn’t any smooth transition to it.

So is it like a bumpy, going up stairs sort of thing?

Yes, when walking on any surface like this one. I can step on it but my capsule simply snaps over it. I forgot to mention that my camera is attached to the head.

Okay, try doing something like this:

124946-path.png

Have two line traces by your feet, one either than the other. The bottom one checks to see if there’s a wall, and the second one checks above it. If the lower one hits and the yellow doesn’t, then we know its a step.

We can set the lengths of both of them for the range of this.

With this information, we can lerp to the height of the yellow line trace, of course, saving its height before we begin the lerp. The height of the yellow line is the threshold for your step height

124947-step.png

Or you can do it like this. Personally, I think this is a more stable version, considering we get more information. Here, we can get the height difference between the two hits, as well as their distance. And, same as before, we have height thresholds that determine if this is a step or not.

The alpha for the lerp needs to be a function off of the player’s location (which will be using get location * forward vector). This way, it will feel like they’re walking up a slope, even though there is none there.

Adjusting the line traces and other parameters can determine how steep or shallow the “slope” will be.

Thanks for the answer. I’ll give it a try.

Did this work?

I tried two methods but it didn’t seem to work (and it might be completely wrong :slight_smile: ). This is the scenario where the traces are going down.
The timeline switches from 0 to 1.
Method 1

Method 2

I know it this is a very old thread but wondering if anyone has a good solution to this yet? Running into the same issue and haven’t been able to solve it.