I’m trying to figure out the best way to implement a shield for a 3rd person melee combat game. Basically what I want to do is make it so that when I hold down the right mouse button, all attacks that hit my player in the front do no damage. My melee system is very simple, the characters right now are just shooting projectiles that disappear after a few feet.
I tried having a box collider parented to my player, positioned at the front, and activate/deactivating it on Fire2, but if I get too close to my enemies, their attacks actually go through the box collider because they’re clipping through it.
Is there a way I could calculate the position of the collision of the melee projectiles when they hit my character, and determine if they are on the front of him?