Blocking

Looking for some help on setting up blocking in my game. It’s a pretty basis sword fighting game. The damage system is set up based off of collision. The sword has a collision box, and when it hits another player’s capsule, it applies damage.
I’m trying to set up a blocking system, that only protects the direction the player is facing. Right now, I have a collision box that sits in front of the player, and is activated when you hit the block botton. I have it set up that if the sword collides w/ the collision box, the swingers of the sword goes into a recoil animation, this works most of the time, but some times the sword still colides with the player capsule and the blocking collision box, so damage is still being applied. Any ideas how to fix?
I know there are simplier ways to do blocking, but I want it to be somewhat directional. I.E. Someone can hit you in the back and still apply damage even if you are blocking.
Thank you!