Proper way of doing hit velocity?

Aye. You’re looking for dot product whose value goes from -1 <> 1 and, if needed, can be treated as an angle in degrees or radians.

Try this:

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:

1 Like