# Prevent Capsule To Snap To Ground When Walking?

**URL:** <https://forums.unrealengine.com/t/prevent-capsule-to-snap-to-ground-when-walking/383729>\
**Category:** Character & Animation\
**Tags:** capsule-component, unreal-engine, question, snapping\
**Created:** [February 2, 2017, 3:07pm UTC](https://forums.unrealengine.com/t/prevent-capsule-to-snap-to-ground-when-walking/383729 "2017-02-02T15:07:42Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xanadron](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xanadron](https://forums.unrealengine.com/u/Xanadron)\
**Post date:** [February 2, 2017, 3:07pm UTC](https://forums.unrealengine.com/t/prevent-capsule-to-snap-to-ground-when-walking/383729/1 "2017-02-02T15:07:42Z")

</div>

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!

 ![124644-capsule.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/3/b/03b0f76a28e1def07e7fe592b67195c89dec9e3c.png)

---

<div class="post-metadata">

**Author:** ![Willard720](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Willard720](https://forums.unrealengine.com/u/Willard720)\
**Post date:** [February 2, 2017, 3:33pm UTC](https://forums.unrealengine.com/t/prevent-capsule-to-snap-to-ground-when-walking/383729/2 "2017-02-02T15:33:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Xanadron](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xanadron](https://forums.unrealengine.com/u/Xanadron)\
**Post date:** [February 2, 2017, 3:39pm UTC](https://forums.unrealengine.com/t/prevent-capsule-to-snap-to-ground-when-walking/383729/3 "2017-02-02T15:39:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Willard720](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Willard720](https://forums.unrealengine.com/u/Willard720)\
**Post date:** [February 3, 2017, 3:37am UTC](https://forums.unrealengine.com/t/prevent-capsule-to-snap-to-ground-when-walking/383729/4 "2017-02-03T03:37:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Xanadron](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xanadron](https://forums.unrealengine.com/u/Xanadron)\
**Post date:** [February 3, 2017, 8:16am UTC](https://forums.unrealengine.com/t/prevent-capsule-to-snap-to-ground-when-walking/383729/5 "2017-02-03T08:16:49Z")

</div>

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.

 ![124745-surface.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/c/4/5c40d51a38731c961273922be1b495e4463b215f.jpeg)

---

<div class="post-metadata">

**Author:** ![Willard720](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Willard720](https://forums.unrealengine.com/u/Willard720)\
**Post date:** [February 4, 2017, 9:58am UTC](https://forums.unrealengine.com/t/prevent-capsule-to-snap-to-ground-when-walking/383729/6 "2017-02-04T09:58:39Z")

</div>

Okay, try doing something like this:

![124946-path.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/3/2/8322b983fa4472efbd0bc0cf81b89b888cee5bed.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](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/d/c/0dc382d9b25258b0e7b7119e16a4d4980cbe5913.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.

---

<div class="post-metadata">

**Author:** ![Xanadron](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xanadron](https://forums.unrealengine.com/u/Xanadron)\
**Post date:** [February 4, 2017, 10:04am UTC](https://forums.unrealengine.com/t/prevent-capsule-to-snap-to-ground-when-walking/383729/7 "2017-02-04T10:04:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Willard720](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Willard720](https://forums.unrealengine.com/u/Willard720)\
**Post date:** [February 8, 2017, 5:04pm UTC](https://forums.unrealengine.com/t/prevent-capsule-to-snap-to-ground-when-walking/383729/8 "2017-02-08T17:04:22Z")

</div>

Did this work?

---

<div class="post-metadata">

**Author:** ![Xanadron](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xanadron](https://forums.unrealengine.com/u/Xanadron)\
**Post date:** [February 8, 2017, 6:17pm UTC](https://forums.unrealengine.com/t/prevent-capsule-to-snap-to-ground-when-walking/383729/9 "2017-02-08T18:17:01Z")

</div>

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

 ![125431-1a.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/d/26dc683f35dd0f076c48d818532d782d7e7fc012.png)

 ![125432-1b.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/f/7/3f723f41ab513e998b7fc71bc918f1523178c038.png)

Method 2

 ![125433-2a.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/9/b/e9b3ba25cb94cc312f6ad9da9191c7651e3a2ab2.png)

 ![125434-2b.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/b/6/db60175357a751bb7a8cb887ec53269106fedbb8.png)

---

<div class="post-metadata">

**Author:** ![VladDimitrov](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vladdimitrov/32/1139832_2.png) [@VladDimitrov](https://forums.unrealengine.com/u/VladDimitrov)\
**Post date:** [May 13, 2023, 5:36am UTC](https://forums.unrealengine.com/t/prevent-capsule-to-snap-to-ground-when-walking/383729/10 "2023-05-13T05:36:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![12erplays](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@12erplays](https://forums.unrealengine.com/u/12erplays)\
**Post date:** [August 18, 2024, 1:32pm UTC](https://forums.unrealengine.com/t/prevent-capsule-to-snap-to-ground-when-walking/383729/11 "2024-08-18T13:32:52Z")

</div>

Yes, Check this out, it might help you:

> [@How can i smooth the player eye view when walking on a high step ?](https://forums.unrealengine.com/t/how-can-i-smooth-the-player-eye-view-when-walking-on-a-high-step/4556/15):
>
> Heey, I had the same problem and I think I might have a solution: I used another Camera Boom, which is is set to be a child of the Capsule Component and I added a Skeletal mesh and the regular Camera Boom to that New Boom. note that the new Camera Boom has to be at the location where the Default Mesh is and have a boom length of 0 In the details of the new Camera Boom you have to “enable Camera Lag” and I find best results between 5 and 12 “Camera Lag Speed”. You might also play a little with…
