# How to create God of War targetting system?

**URL:** <https://forums.unrealengine.com/t/how-to-create-god-of-war-targetting-system/210302>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [March 9, 2021, 10:34am UTC](https://forums.unrealengine.com/t/how-to-create-god-of-war-targetting-system/210302 "2021-03-09T10:34:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 9, 2021, 11:52am UTC](https://forums.unrealengine.com/t/how-to-create-god-of-war-targetting-system/210302/2 "2021-03-09T11:52:32Z")

</div>

> [@](#):
>
> Filter out Potential targets that are not in certain Angle in front of you or where your Input Direction goes

[The Dot Product](https://en.wikipedia.org/wiki/Dot_product) of 2 directional vectors will be in range of -1 to 1. Anything that’s above 0 is in front of you, anything below 0 is behind (and every other value in between matters, too!)

 ![dot.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/5/9/597d9fb74cde50833c1b549e857d470ece049cb8.jpeg)

I grab all the actors around the player using a Sphere Overlap (as in the original suggestion) and loop through the elements of the array, checking my angles - Dot player’s forward and the direction to each target. For dot values greater than .5 I mark the target, and add that actor to the array - these are the baddies in my targeting cone:

 ![flitered.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/8/4/84837fa62748a81be12969685c6fbd22c6fa08af.jpeg)

Even though the one on the right is within range of the sphere, it’s not a valid target as it’s _not_ in range of the requested \>.5 dot product value.

To visualise it better, here are the dot values for this setup:

 ![dots.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/0/f/0f01dda3010ef15e9c82112a96af00d341b30f31.jpeg)

---

_[View the full topic](https://forums.unrealengine.com/t/how-to-create-god-of-war-targetting-system/210302)._
