# Collision Response not overriding previous set value

**URL:** <https://forums.unrealengine.com/t/collision-response-not-overriding-previous-set-value/338340>\
**Category:** World Creation\
**Tags:** trace-channels, unreal-engine, collision-responses, Collision, CPP, question\
**Created:** [November 13, 2015, 6:02am UTC](https://forums.unrealengine.com/t/collision-response-not-overriding-previous-set-value/338340 "2015-11-13T06:02:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon36427305](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anon36427305](https://forums.unrealengine.com/u/anon36427305)\
**Post date:** [November 13, 2015, 6:02am UTC](https://forums.unrealengine.com/t/collision-response-not-overriding-previous-set-value/338340/1 "2015-11-13T06:02:18Z")

</div>

I have created a capsule which I will use for single line tracing on only one channel and do not wish the main actor to be blocked by the capsule.

To do this I set the collision responses to:

```
CapsuleComponent->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Ignore);
CapsuleComponent->SetCollisionResponseToChannel(COLLISION_WEAPON, ECollisionResponse::ECR_Block);

```

In theory this would set all channels to ignore collisions and only the COLLISION\_WEAPON channel (Engine Trace Channel 1) to be colliding with the object.

Unfortunately when I add the actor to the editor, all channels are ignored and the one I would like to be blocked is also ignored.

Any ideas of why this would be happening/solutions as I would prefer to define this in my objects constructor, rather than edit it for each object in the editor.

---

<div class="post-metadata">

**Author:** ![anon36427305](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anon36427305](https://forums.unrealengine.com/u/anon36427305)\
**Post date:** [November 14, 2015, 7:39am UTC](https://forums.unrealengine.com/t/collision-response-not-overriding-previous-set-value/338340/2 "2015-11-14T07:39:52Z")

</div>

Don’t worry, I figured it out. I just created a custom Collision Profile and used:

```
CapsuleComponent->SetCollisionProfileName

```

to set the collision properties to that collision profile.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_42a36632](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_42a36632](https://forums.unrealengine.com/u/anonymous_user_42a36632)\
**Post date:** [December 14, 2015, 1:41pm UTC](https://forums.unrealengine.com/t/collision-response-not-overriding-previous-set-value/338340/3 "2015-12-14T13:41:57Z")

</div>

Hello,  
could you give some more informations how you solved this?

---

<div class="post-metadata">

**Author:** ![anon36427305](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anon36427305](https://forums.unrealengine.com/u/anon36427305)\
**Post date:** [December 18, 2015, 9:16am UTC](https://forums.unrealengine.com/t/collision-response-not-overriding-previous-set-value/338340/4 "2015-12-18T09:16:17Z")

</div>

Hi ,

In the constructor of the object you will define a component, as an example lets say that I have created a Sphere component which I only want to have events fire for the hit of custom Trace Channel.

I create it like so:

```
SphereOverlapComponent = CreateDefaultSubobject<USphereComponent>(TEXT("SphereOverlapComponent"));

```

Then in the unreal engine under \_\_\_\_\_\_\_ you create a custom collision profile mine looks like this:

 ![71128-collision.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/b/9/1b9bdc427959cc080ff6f0afbd832a2da20fb7b4.png)

Then to have that component use that collision profile you define it like this:

```
SphereOverlapComponent->SetCollisionProfileName("UsableItemOverlap");

```

Hope that helps.
