# Is it possible to prevent overlap but detect collision?

**URL:** <https://forums.unrealengine.com/t/is-it-possible-to-prevent-overlap-but-detect-collision/1818594>\
**Category:** Programming & Scripting\
**Tags:** collision-detection, unreal-engine, Collision, Blueprint\
**Created:** [April 24, 2024, 7:19am UTC](https://forums.unrealengine.com/t/is-it-possible-to-prevent-overlap-but-detect-collision/1818594 "2024-04-24T07:19:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![NightmareGames](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nightmaregames/32/711529_2.png) [@NightmareGames](https://forums.unrealengine.com/u/NightmareGames)\
**Post date:** [April 24, 2024, 7:19am UTC](https://forums.unrealengine.com/t/is-it-possible-to-prevent-overlap-but-detect-collision/1818594/1 "2024-04-24T07:19:08Z")

</div>

I have a scenario in which a physics-enabled object (let’s call it Cube 1) falls onto a static object (Cube 2). I want to detect when Cube 1 hits Cube 2 so I can perform some logic at that moment. However, I don’t want Cube 1 to fall through Cube 2.

Setting collisions to BlockAll on the static mesh fixes the visual issue, but stops overlap events from firing.  
 ![cubes1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/8/6/f8638ba510483efe85c56e57af97ac754a921afb.jpeg)

Conversely, setting them to OverlapAll causes events to fire, but the cubes visually fall right through each other (and, in fact, the terrain itself) and keep going.  
 ![cubes2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/d/9/ad9fe9b69abed143554a04456651897bb8eb0050.jpeg)

Fiddling around with custom collision settings generally results in one or the other. At one point I managed to get them to stop falling through the terrain at least, but I don’t recall which magic combination of settings did the trick.

Is there a good way to detecting when the cubes touch but without allowing them to clip through each other visually?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 24, 2024, 7:25am UTC](https://forums.unrealengine.com/t/is-it-possible-to-prevent-overlap-but-detect-collision/1818594/2 "2024-04-24T07:25:22Z")

</div>

> [@NightmareGames](#):
>
> Cube 1 hits Cube 2

It’s called:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/1/9/019f5571ce49a6b9729aa68841ad0420e6f12141.png)

---

<div class="post-metadata">

**Author:** ![NightmareGames](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nightmaregames/32/711529_2.png) [@NightmareGames](https://forums.unrealengine.com/u/NightmareGames)\
**Post date:** [April 24, 2024, 7:31am UTC](https://forums.unrealengine.com/t/is-it-possible-to-prevent-overlap-but-detect-collision/1818594/3 "2024-04-24T07:31:46Z")

</div>

I have a breakpoint set on Event Hit already. If I block collisions, the event never fires. If I allow overlap, the event fires, but the blocks fall through.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 24, 2024, 7:34am UTC](https://forums.unrealengine.com/t/is-it-possible-to-prevent-overlap-but-detect-collision/1818594/4 "2024-04-24T07:34:14Z")

</div>

The collision is then set up incorrectly. Set Block All (for now), follow the instructions in the tooltip.

> If I allow overlap, the event fires

Hit Events do not fire on overlap - so you have something dodgy going on there.

---

<div class="post-metadata">

**Author:** ![NightmareGames](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nightmaregames/32/711529_2.png) [@NightmareGames](https://forums.unrealengine.com/u/NightmareGames)\
**Post date:** [April 24, 2024, 7:36am UTC](https://forums.unrealengine.com/t/is-it-possible-to-prevent-overlap-but-detect-collision/1818594/5 "2024-04-24T07:36:58Z")

</div>

I see. I didn’t have “Simulation Generates Hit Events” enabled. Now it works. Thanks!
