Check which direction the player was hit from?

These are just common mathematical functions, I don’t think I can explain it better than the Wikipedia can.

Dot product - Wikipedia

Inverse trigonometric functions - Wikipedia

Edtd: Basically these two nodes together return the angle between two vectors.