# OnComponentBeginOverlap not firing

**URL:** <https://forums.unrealengine.com/t/oncomponentbeginoverlap-not-firing/418092>\
**Category:** World Creation\
**Tags:** unreal-engine, Collision, CPP, question, box-overlap\
**Created:** [February 22, 2018, 10:16pm UTC](https://forums.unrealengine.com/t/oncomponentbeginoverlap-not-firing/418092 "2018-02-22T22:16:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cd1232](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cd1232](https://forums.unrealengine.com/u/Cd1232)\
**Post date:** [February 22, 2018, 10:16pm UTC](https://forums.unrealengine.com/t/oncomponentbeginoverlap-not-firing/418092/1 "2018-02-22T22:16:58Z")

</div>

Hi,

I’m having a problem where 2 of my objects are not generating overlap events, they’re both world static, and they’re definitely colliding with each other.

 ![231691-colliding.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/7/c/57c415fe7c618ce7d18401c40b8ef3268d9650b8.png)

And here are the collision profiles for the box colliders on each of them

 ![231692-beamcollision.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/4/c/44c7fd14e47ee50092e843dfd8df653248d78057.png)

![231693-mirroroverlap.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/9/5/695974bf5e9ef79fda67de479eaa7a938bc650a5.png)

And here’s the code for one of the classes, light beam also has a begin overlap but still no luck

 ![231694-mirrorcode.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/6/8/c68de4f66f4ed7d8c048a1fb1e26a0523e1b9017.png)

 ![231695-mirrorcode2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/3/f/33f44f097ffb6f30190e910b875d83fa2a649146.png)

---

<div class="post-metadata">

**Author:** ![Lucas\_False](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lucas\_False](https://forums.unrealengine.com/u/Lucas_False)\
**Post date:** [February 22, 2018, 10:19pm UTC](https://forums.unrealengine.com/t/oncomponentbeginoverlap-not-firing/418092/2 "2018-02-22T22:19:04Z")

</div>

Did you enable generate overlap events?

[https://puu.sh/ztzcA/ed62a216c5.jpg](https://puu.sh/ztzcA/ed62a216c5.jpg)

---

<div class="post-metadata">

**Author:** ![Cd1232](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cd1232](https://forums.unrealengine.com/u/Cd1232)\
**Post date:** [February 22, 2018, 10:29pm UTC](https://forums.unrealengine.com/t/oncomponentbeginoverlap-not-firing/418092/3 "2018-02-22T22:29:33Z")

</div>

More info: If both objects are set to OverlapAllDynamic they do not generate an overlap event (even though they should), but if one or both are set to OverlapAll they do generate the event properly.

---

<div class="post-metadata">

**Author:** ![Cd1232](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cd1232](https://forums.unrealengine.com/u/Cd1232)\
**Post date:** [February 22, 2018, 10:30pm UTC](https://forums.unrealengine.com/t/oncomponentbeginoverlap-not-firing/418092/4 "2018-02-22T22:30:49Z")

</div>

As you can see in the constructor, Generate overlap events is set to true, same for the other object

---

<div class="post-metadata">

**Author:** ![ThompsonN13](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ThompsonN13](https://forums.unrealengine.com/u/ThompsonN13)\
**Post date:** [February 22, 2018, 10:45pm UTC](https://forums.unrealengine.com/t/oncomponentbeginoverlap-not-firing/418092/5 "2018-02-22T22:45:03Z")

</div>

from what i can tell overlap dynamic wont work because they are static as stated in your first post. and i would expect that begin overlap wouldnt work in general because when the level is constructed they are already overlapping. but thats just my opinion based on my blueprint experience.

---

<div class="post-metadata">

**Author:** ![Cd1232](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cd1232](https://forums.unrealengine.com/u/Cd1232)\
**Post date:** [February 22, 2018, 10:53pm UTC](https://forums.unrealengine.com/t/oncomponentbeginoverlap-not-firing/418092/6 "2018-02-22T22:53:14Z")

</div>

My mistake, they were actually both world dynamic. And I also found out that they aren’t actually colliding with each other, but the longer object was colliding with the spectator pawn and that’s what triggered that event

---

<div class="post-metadata">

**Author:** ![Cd1232](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cd1232](https://forums.unrealengine.com/u/Cd1232)\
**Post date:** [February 22, 2018, 11:15pm UTC](https://forums.unrealengine.com/t/oncomponentbeginoverlap-not-firing/418092/7 "2018-02-22T23:15:21Z")

</div>

I have to say that the answer to this is really sad. The reason the event did not fire is because they were already overlapping when I pressed play. If I start with them separated and move one object into the other, the event will happen.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_277c86b9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_277c86b9](https://forums.unrealengine.com/u/anonymous_user_277c86b9)\
**Post date:** [February 22, 2018, 11:49pm UTC](https://forums.unrealengine.com/t/oncomponentbeginoverlap-not-firing/418092/8 "2018-02-22T23:49:40Z")

</div>

but the problem is something else. you must use `UFUNCTION()` marco on your overlap function

---

<div class="post-metadata">

**Author:** ![rit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rit](https://forums.unrealengine.com/u/rit)\
**Post date:** [January 4, 2024, 7:21am UTC](https://forums.unrealengine.com/t/oncomponentbeginoverlap-not-firing/418092/9 "2024-01-04T07:21:10Z")

</div>

> [@anonymous\_user\_277c86b9](#):
>
> UFUNCTION()

Thanks man!

I’ve checked:

1. Collision channels (for both instigator actor and overlapped actor)
2. Call SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
3. Move binding delegates from C++ constructor to BeginPlay()
4. Adding UFUNCTION() macro to the delegate function finally solves the issue!
