# Proper way of doing hit velocity?

**URL:** <https://forums.unrealengine.com/t/proper-way-of-doing-hit-velocity/960092>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, Physics, hit-event, Blueprint, question\
**Created:** [April 14, 2023, 3:43pm UTC](https://forums.unrealengine.com/t/proper-way-of-doing-hit-velocity/960092 "2023-04-14T15:43:23Z")\
**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:** [April 14, 2023, 5:29pm UTC](https://forums.unrealengine.com/t/proper-way-of-doing-hit-velocity/960092/2 "2023-04-14T17:29:26Z")

</div>

> [@Mr\_Robville](#):
>
> I’d guess that the Hit Normal from the Event Hit node could be involved with this, but I can’t seem to make too much sense of it yet, if it’s even related at all.

Aye. You’re looking for [`dot product`](https://en.wikipedia.org/wiki/Dot_product) whose value goes from -1 \<\> 1 and, if needed, can be treated as an angle in degrees or radians.

Try this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/0/c/e0ce150d17e988972dcff5b11332df6e3404bc7a.jpeg)

It would only print if we hit a wall at 45 deg or so which is dot .7 or thereabouts. In short:

- compare the normal of the hit surface with the direction the character is facing
- stuff behind us is below 0, ahead of you is above 0, and all the values in between

* * *

To visualise what dot product is doing:

> [@How to create God of War targetting system?](https://forums.unrealengine.com/t/how-to-create-god-of-war-targetting-system/210302/2):
>
> [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!) 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…

---

_[View the full topic](https://forums.unrealengine.com/t/proper-way-of-doing-hit-velocity/960092)._
