# How to tell if an actor is moving backwards or forwards?

**URL:** <https://forums.unrealengine.com/t/how-to-tell-if-an-actor-is-moving-backwards-or-forwards/7855>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [July 19, 2014, 11:40am UTC](https://forums.unrealengine.com/t/how-to-tell-if-an-actor-is-moving-backwards-or-forwards/7855 "2014-07-19T11:40:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_f2dd594d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f2dd594d](https://forums.unrealengine.com/u/anonymous_user_f2dd594d)\
**Post date:** [July 19, 2014, 11:40am UTC](https://forums.unrealengine.com/t/how-to-tell-if-an-actor-is-moving-backwards-or-forwards/7855/1 "2014-07-19T11:40:29Z")

</div>

Does anyone know how to tell if an actor is moving forwards or backwards relative to their rotation, even if it’s a speed in positive & negative numbers for forwards & backwards?

I’ve tried using Velocity and Forward Vector but I can’t seem to do anything with the data to get that result.

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_dede2580](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_dede2580](https://forums.unrealengine.com/u/anonymous_user_dede2580)\
**Post date:** [July 19, 2014, 11:49am UTC](https://forums.unrealengine.com/t/how-to-tell-if-an-actor-is-moving-backwards-or-forwards/7855/2 "2014-07-19T11:49:45Z")

</div>

If you take the dot product of the normalized velocity vector and the forward vector, the result will be near positive 1 when moving forwards (relative actor rotation) and near negative 1 when moving backwards:

![forwardvelodot.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/b/9/fb9d58af6d6379e1af154e00985213d989c054c2.png)

The float output at the end is what you’re after. Technically you could skip the normalization and then just check if the output is larger than zero (forward), or less than zero (backward), but you would probably want to allow for some noise in the results. For example, a result of 0.00004359758 or something probably means you’re not really moving noticeably at all rather than definitely forwards, even though it’s technically larger than zero.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f2dd594d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f2dd594d](https://forums.unrealengine.com/u/anonymous_user_f2dd594d)\
**Post date:** [July 19, 2014, 12:20pm UTC](https://forums.unrealengine.com/t/how-to-tell-if-an-actor-is-moving-backwards-or-forwards/7855/3 "2014-07-19T12:20:28Z")

</div>

Thank you very much 🙂

---

<div class="post-metadata">

**Author:** ![thankstipscom](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@thankstipscom](https://forums.unrealengine.com/u/thankstipscom)\
**Post date:** [April 15, 2015, 7:42am UTC](https://forums.unrealengine.com/t/how-to-tell-if-an-actor-is-moving-backwards-or-forwards/7855/4 "2015-04-15T07:42:00Z")

</div>

thanks.

this helped me today. so simple to get in the end.

---

<div class="post-metadata">

**Author:** ![Nawrot](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nawrot/32/618260_2.png) [@Nawrot](https://forums.unrealengine.com/u/Nawrot)\
**Post date:** [April 15, 2015, 11:05am UTC](https://forums.unrealengine.com/t/how-to-tell-if-an-actor-is-moving-backwards-or-forwards/7855/5 "2015-04-15T11:05:25Z")

</div>

Yup dot product is great for this.

To test use “nearly equal” node. Value of .95 is forward enough for human brain when it interprets directions.

---

<div class="post-metadata">

**Author:** ![Manim8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Manim8](https://forums.unrealengine.com/u/Manim8)\
**Post date:** [April 20, 2022, 9:37pm UTC](https://forums.unrealengine.com/t/how-to-tell-if-an-actor-is-moving-backwards-or-forwards/7855/6 "2022-04-20T21:37:13Z")

</div>

Hi. I know this is a really old thread, but, I’m having problems with this solution in that, it only works when my pawn is facing a certain direction in the world. If I turn around then the 1 and -1 are inverted. I’m probably doing something wrong, but, could you explain what nodes I need for this setup with the Dot Product node. What is a “normalized velocity vector”?  
My setup is  
Get Actor Location - Dot Product Top Pin,  
Get Velocity (self) - Dot Product Bottom Pin.  
Although I’ve tried switching the pins around, I can’t get the 1 / -1 values to be consistent with the rotation of the pawn. I’ve also played around with ‘Get Forward Vector’ but had no joy. Any help would be appreciated 😄

---

<div class="post-metadata">

**Author:** ![lehuan5062](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lehuan5062](https://forums.unrealengine.com/u/lehuan5062)\
**Post date:** [June 10, 2022, 11:31am UTC](https://forums.unrealengine.com/t/how-to-tell-if-an-actor-is-moving-backwards-or-forwards/7855/7 "2022-06-10T11:31:12Z")

</div>

You’re supposed to get physics linear velocity and get forward vector.

---

<div class="post-metadata">

**Author:** ![zeth\_foxster](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zeth\_foxster](https://forums.unrealengine.com/u/zeth_foxster)\
**Post date:** [June 19, 2022, 8:49pm UTC](https://forums.unrealengine.com/t/how-to-tell-if-an-actor-is-moving-backwards-or-forwards/7855/8 "2022-06-19T20:49:26Z")

</div>

this seems important but is not explained enough.
