# Only root component's collision is being detected

**URL:** <https://forums.unrealengine.com/t/only-root-components-collision-is-being-detected/316917>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [April 30, 2015, 12:22am UTC](https://forums.unrealengine.com/t/only-root-components-collision-is-being-detected/316917 "2015-04-30T00:22:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_eb3276d7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_eb3276d7](https://forums.unrealengine.com/u/anonymous_user_eb3276d7)\
**Post date:** [April 30, 2015, 12:22am UTC](https://forums.unrealengine.com/t/only-root-components-collision-is-being-detected/316917/1 "2015-04-30T00:22:01Z")

</div>

I have a box component as root collision, and it’s working. But now I want to add a trigger box to this actor and the trigger box’s onBeginOverlap function is not being triggered. Seems like only the component’s collision is being detected.

How do I make component’s collision work?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d4cefbf7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d4cefbf7](https://forums.unrealengine.com/u/anonymous_user_d4cefbf7)\
**Post date:** [May 1, 2015, 12:43pm UTC](https://forums.unrealengine.com/t/only-root-components-collision-is-being-detected/316917/2 "2015-05-01T12:43:49Z")

</div>

Hello,

To make the component collision work, you can do the following:

1. Declare the Prox() function in your Actor:

//for native C++ implementation

```
virtual void Prox_Implementation(AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult & SweepResult);

```

1. Implement it :

2. Declare Proximity spheres for your collisions in your Actor:

3. In Actor’s constructor, initialize the components, attach them to root and bind the Prox() method:

4. Place your Actor in the level. Select Box components in Details tab and place them according to your needs.  
This should do it. Also please don’t forget to check collision settings for the Boxes (especially Generate Overlap Events flag).  
Hope this helped!  
Cheers!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_eb3276d7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_eb3276d7](https://forums.unrealengine.com/u/anonymous_user_eb3276d7)\
**Post date:** [May 7, 2015, 2:51am UTC](https://forums.unrealengine.com/t/only-root-components-collision-is-being-detected/316917/3 "2015-05-07T02:51:02Z")

</div>

thanks you, it works.

but I got this warning, which I am a little bit concerned. Should I ignore it?

Warning 3 warning C4996: Function PortalTile::OnBlueEndTriggerOverlap\_Implementation needs native implementation by virtual void OnBlueEndTriggerOverlap\_Implementation(AActor\* OtherActor, UPrimitiveComponent\* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) due to its properties. Currently OnBlueEndTriggerOverlap\_Implementation declaration is autogenerated by UHT. Since next release you’ll have to provide declaration on your own. Please update your code before upgrading to the next release, otherwise your project will no longer compile. d:\projecttap\source\projecttap\tiles\PortalTile.h(14)(

---

<div class="post-metadata">

**Author:** ![Napoleonite](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Napoleonite](https://forums.unrealengine.com/u/Napoleonite)\
**Post date:** [May 22, 2016, 10:14am UTC](https://forums.unrealengine.com/t/only-root-components-collision-is-being-detected/316917/4 "2016-05-22T10:14:36Z")

</div>

Actually the non-root-component collision detection does work but **only** for collision with **pawns**. Because of this weird behavior I assumed that it was an UE4-bug (and I still do not know why the UE4 devs designed it like this). Took me a while to figure it out.

> **[Collision Component MUST be placed in root](https://forums.unrealengine.com/questions/407622/collision-component-must-be-placed-in-root.html)**
>
> See this topic: Bouncing projectiles have no collision - World Creation - Unreal Engine Forums This is such weird behavior + so bothersome when using inheritance that I assume that this is a bug. I mean we have like dozens of collision-settings but...

Glad there is finally a post with a c++ workaround though. Especially for cases where you use inheritance and need different collision-shapes depending on the child-blueprint.
