• News
• About

• Industries

• Learning & Support

• Community

• Marketplace

Download

# Collision with back

Hi all…
How i can check if the enemy have touched my back?
With a collision sphere on the character?

you can get forward vector from you character and determine the angle between it and your enemy.

ehm…how…? xD

Vector Math. Get the ForwardVector of both (if you don’t know how, just google. You should find information about that).

Then normalize these vectors and make the DOT Product. That’s an actual node, like multiply etc. The result of the DOT Product
gives you the information you need.

And before i keep on explaining something you can find by googling:

https://www.youtube.com/watch?v=Q9FZllr6-wY

You have better chances of detecting if he is facing comparing degrees (usually the difference of the forward vectrors is ± 45 deg or π/4).
If you want to see if he is touching your back just add a trigger shape and you should be able to see if he is there with overlap events