# Linetrace for stair intersection

**URL:** <https://forums.unrealengine.com/t/linetrace-for-stair-intersection/414644>\
**Category:** Blueprint\
**Tags:** line-trace, move-component-to, unreal-engine, question, Blueprint\
**Created:** [January 15, 2018, 8:50pm UTC](https://forums.unrealengine.com/t/linetrace-for-stair-intersection/414644 "2018-01-15T20:50:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_215ca9db](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_215ca9db](https://forums.unrealengine.com/u/anonymous_user_215ca9db)\
**Post date:** [January 15, 2018, 8:50pm UTC](https://forums.unrealengine.com/t/linetrace-for-stair-intersection/414644/1 "2018-01-15T20:50:55Z")

</div>

Hello everybody,  
I would like to build a linetrace which shoud be directed downwards in front of my character, so that whenever my character is in front of a slope he adds its height to his current position.  
In the end I would like to achieve that my charakter can go up stairs.

Thanks in advance for your help.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_49a519741](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_49a519741](https://forums.unrealengine.com/u/anonymous_user_49a519741)\
**Post date:** [January 15, 2018, 9:08pm UTC](https://forums.unrealengine.com/t/linetrace-for-stair-intersection/414644/2 "2018-01-15T21:08:09Z")

</div>

I don’t know if that’s the right way to handle stairs. For someone starting out, it’s best to use a stair mesh but the character is actually walking up a ramp. The problem with that is the feet don’t always land on the steps as they should.

To fix that, you want to use IK. Along with IK, you shoot traces out of the bottom of the character’s feet. It is very complicated so if you aren’t very experienced, I suggest you deal with the feet not lining up with the stairs and work on other parts of your project. You can always come back.

If you want to do the IK for stairs now, you should check out a tutorial. I found two but neither finishes with a perfect example. Still, they will have lots of info to get you on your way.

First one (playlist):  
https://www.youtube.com/embed/3lkk1ish294?feature=oembed&wmode=opaque&list=PLY_FQXauSxlBxwbFyeVRCRRHd9I7yRhpi

Second one (first video of three):

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/a/7/7a79ef89369adb7f6c7ecbc490bcb019d9da3319.jpeg "TPS Build Part 13 - IK Foot Trace (Part 1)") ](https://www.youtube.com/watch?v=6WzcxzqtpJg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_dceb25d5](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_dceb25d5](https://forums.unrealengine.com/u/anonymous_user_dceb25d5)\
**Post date:** [January 15, 2018, 9:12pm UTC](https://forums.unrealengine.com/t/linetrace-for-stair-intersection/414644/3 "2018-01-15T21:12:41Z")

</div>

use complex collision as simple, way easier that way.

> **[Physics](https://docs.unrealengine.com/5.1/en-US/physics-in-unreal-engine/)**
>
> Subsystem that calculates collision and simulate physical actors.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_215ca9db](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_215ca9db](https://forums.unrealengine.com/u/anonymous_user_215ca9db)\
**Post date:** [January 15, 2018, 10:56pm UTC](https://forums.unrealengine.com/t/linetrace-for-stair-intersection/414644/4 "2018-01-15T22:56:45Z")

</div>

Thank you very much for your quick response.  
I’ll try it tomorrow. In the end it is for VR Template and custom gravity. Everytime I move I want to check for a collision object in front of me to then apply the z offset to my character.
