# Blocking

**URL:** <https://forums.unrealengine.com/t/blocking/736445>\
**Category:** Blueprint\
**Tags:** block, ue, blocking, unreal-engine, Blueprint, question\
**Created:** [December 26, 2022, 5:22pm UTC](https://forums.unrealengine.com/t/blocking/736445 "2022-12-26T17:22:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![drewjohnson71](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@drewjohnson71](https://forums.unrealengine.com/u/drewjohnson71)\
**Post date:** [December 26, 2022, 5:22pm UTC](https://forums.unrealengine.com/t/blocking/736445/1 "2022-12-26T17:22:01Z")

</div>

I understand how to do basic blocking, click the block button, turn on a blocking variable, and while character is blocking they cannot be damaged.  
What I’m hoping to do is make it only block damage from one direction. If I am facing an enemy and block, I avoid damage to the front, but if I’m fighting two enemies and one hits me in the back, I want to take damage. Any suggestions on how to do this?  
I’ve experimented with creating a collision box in front of the player, so whenever I hit the block button, it turns on collision, and when the enemies sword overlaps, it cancels the attack and causes the enemy to recoil/stagger back. The issue is, when getting attack from behind, the enemy sword still hits the collision box and cancels the attack, etc.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/2/e/72e6bb5c35c34e95f79961af11080b0036ba20bb.jpeg)

---

<div class="post-metadata">

**Author:** ![drewjohnson71](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@drewjohnson71](https://forums.unrealengine.com/u/drewjohnson71)\
**Post date:** [December 26, 2022, 5:24pm UTC](https://forums.unrealengine.com/t/blocking/736445/2 "2022-12-26T17:24:43Z")

</div>

Here is a better angle of the collision box, if that helps

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/c/6/2c6309682ba7872b4cee330fd0001e0cd0fd1f11.jpeg)

---

<div class="post-metadata">

**Author:** ![drewjohnson71](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@drewjohnson71](https://forums.unrealengine.com/u/drewjohnson71)\
**Post date:** [December 26, 2022, 5:30pm UTC](https://forums.unrealengine.com/t/blocking/736445/3 "2022-12-26T17:30:57Z")

</div>

The attacking system I have is; a weapon blueprint, each weapon has a collision box, when the collision box of the weapon overlaps with an enemy’s Collision Cylinder, it applies damage. Far from a perfect system, but this is what I’ve done so far. When the enemy hits a blocking player, it turns on a “recoil” so the logic is, if the enemy is recoiling, damage isn’t applied. Part of the problem I have is, the enemy gets really close, and when it swings it’s sword, it will sometimes trigger an overlap w/ the capsule before the block box, which is why I added this delay before applying damage.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/3/a/e3ad40de1e23f09440107f371b6773774ffae4da.png)
