# Calculating Walk Speed Based On Slope and Direction

**URL:** <https://forums.unrealengine.com/t/calculating-walk-speed-based-on-slope-and-direction/440638>\
**Category:** Character & Animation\
**Tags:** unreal-engine, player, slope, question\
**Created:** [January 4, 2019, 10:04pm UTC](https://forums.unrealengine.com/t/calculating-walk-speed-based-on-slope-and-direction/440638 "2019-01-04T22:04:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brisck1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@brisck1](https://forums.unrealengine.com/u/brisck1)\
**Post date:** [January 4, 2019, 10:04pm UTC](https://forums.unrealengine.com/t/calculating-walk-speed-based-on-slope-and-direction/440638/1 "2019-01-04T22:04:39Z")

</div>

So I’m working on movement for my first-person character and I want to slow the player down when travelling up slopes and speed them up when travelling down them.

So far I have discovered that you can get the floor normal from the player character movement component:

 ![264205-slope1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/5/a/c5ae4b459fb7ec1592ee83eae8476214a787257f.jpeg)

Which is great, however my problem is that I need to somehow take this normal and check it relative to my movement direction/velocity (not my facing direction, due to strafing etc.) so that I can determine if I’m going up or down a slope when i’m moving.

This is where my mathematical knowledge falls short unfortunately, so any help on this would be much appreciated!

Thanks.

---

<div class="post-metadata">

**Author:** ![Neverender](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Neverender](https://forums.unrealengine.com/u/Neverender)\
**Post date:** [January 6, 2019, 5:57am UTC](https://forums.unrealengine.com/t/calculating-walk-speed-based-on-slope-and-direction/440638/2 "2019-01-06T05:57:08Z")

</div>

I think the special sauce you’re looking for is the vector dot product. For two normalized vectors, their dot product will be 1 if they point in the exact same direction, -1 if they point in exactly opposite directions, or 0 if they are at a right angle to one another.

This means that `surfaceNormal (dot) walkingDirection` will return 0 for a flat/horizontal surface, increase toward +1 for when moving downhill, or decrease toward -1 for an incline/uphill.

Given that, I think you’re looking for something along these lines:

> **[Movement incline posted by Neverender | blueprintUE | PasteBin For Unreal...](https://blueprintue.com/blueprint/0zwq81_d/)**
>
> No description provided

 ![264360-blueprint-incline.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/0/7/20790eef50e09c4b52df4f5b75b0bd336366264b.png)

---

<div class="post-metadata">

**Author:** ![TheWeeky](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheWeeky](https://forums.unrealengine.com/u/TheWeeky)\
**Post date:** [January 7, 2026, 10:49am UTC](https://forums.unrealengine.com/t/calculating-walk-speed-based-on-slope-and-direction/440638/3 "2026-01-07T10:49:19Z")

</div>

How to use this? Print string doesn’t go off and plugging it instead of with UpdateCustomMovement either makes my character not be able to walk or the print string value doesn’t change

---

<div class="post-metadata">

**Author:** ![Wayne\_Tang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Wayne\_Tang](https://forums.unrealengine.com/u/Wayne_Tang)\
**Post date:** [January 23, 2026, 9:22am UTC](https://forums.unrealengine.com/t/calculating-walk-speed-based-on-slope-and-direction/440638/4 "2026-01-23T09:22:37Z")

</div>

Cos
