# Finding if two forward vectors face each other

**URL:** <https://forums.unrealengine.com/t/finding-if-two-forward-vectors-face-each-other/401893>\
**Category:** Blueprint\
**Tags:** forward-vector, unreal-engine, vector, UE4, question, Blueprint\
**Created:** [August 12, 2017, 9:12pm UTC](https://forums.unrealengine.com/t/finding-if-two-forward-vectors-face-each-other/401893 "2017-08-12T21:12:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lonesmith](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lonesmith](https://forums.unrealengine.com/u/Lonesmith)\
**Post date:** [August 12, 2017, 9:12pm UTC](https://forums.unrealengine.com/t/finding-if-two-forward-vectors-face-each-other/401893/1 "2017-08-12T21:12:03Z")

</div>

Hello,

I am trying to find out if the forward vector of “Actor A” faces towards the forward vector of “Actor B” or if it faces away from it. I just cant seem to figure it out.

 ![193556-picture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/d/a/3da8ebe30e9fc1891eea0c6abdd949c6b850581e.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9fcda7641](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9fcda7641](https://forums.unrealengine.com/u/anonymous_user_9fcda7641)\
**Post date:** [August 12, 2017, 10:13pm UTC](https://forums.unrealengine.com/t/finding-if-two-forward-vectors-face-each-other/401893/2 "2017-08-12T22:13:45Z")

</div>

With the dot product of both forward vectors you can get which direction they are facing. If the dot product is greater than 0 both vectors are pointing in the same direction, if the dot product of both forward vectors is less than 0 the two vectors are facing in opposite directions.

 ![204282-dot.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/f/7/5f7ca2673d3d0bd226e75082bd4826284699b67c.jpeg)

---

<div class="post-metadata">

**Author:** ![Lonesmith](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lonesmith](https://forums.unrealengine.com/u/Lonesmith)\
**Post date:** [August 12, 2017, 10:27pm UTC](https://forums.unrealengine.com/t/finding-if-two-forward-vectors-face-each-other/401893/3 "2017-08-12T22:27:58Z")

</div>

Exactly what i was looking for. Thank you

---

<div class="post-metadata">

**Author:** ![mvollrath](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mvollrath](https://forums.unrealengine.com/u/mvollrath)\
**Post date:** [December 11, 2020, 12:02am UTC](https://forums.unrealengine.com/t/finding-if-two-forward-vectors-face-each-other/401893/4 "2020-12-11T00:02:10Z")

</div>

This helped me 3 years later… Thank you!
