# How can I Create custom collision Object Type and make it avaliable in C++?

**URL:** <https://forums.unrealengine.com/t/how-can-i-create-custom-collision-object-type-and-make-it-avaliable-in-c/378315>\
**Category:** World Creation\
**Tags:** unreal-engine, Collision, CPP, question\
**Created:** [December 4, 2016, 11:53pm UTC](https://forums.unrealengine.com/t/how-can-i-create-custom-collision-object-type-and-make-it-avaliable-in-c/378315 "2016-12-04T23:53:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ambience\_Lee](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ambience\_Lee](https://forums.unrealengine.com/u/Ambience_Lee)\
**Post date:** [December 4, 2016, 11:53pm UTC](https://forums.unrealengine.com/t/how-can-i-create-custom-collision-object-type-and-make-it-avaliable-in-c/378315/1 "2016-12-04T23:53:07Z")

</div>

So I created an Object type in the project settings, it’s name is Item.  
I try to define it inside of c++ code:  
pickupTrigger-\>SetCollisionObjectType(xxx);

but apparently I don’t have and option of Item, I guess the editor defined new object type is not being aware by the c++ code…

So how can I make it avaliable here?

Thanks,

JT

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [December 5, 2016, 2:12am UTC](https://forums.unrealengine.com/t/how-can-i-create-custom-collision-object-type-and-make-it-avaliable-in-c/378315/2 "2016-12-05T02:12:10Z")

</div>

You either need to add them here by modifying engine:

[https://github.com/EpicGames/UnrealEngine/blob/55c9f3ba0010e2e483d49a4cd378f36a46601fad/Engine/Source/Runtime/Engine/Classes/Engine/EngineTypes.h#L581](https://github.com/EpicGames/UnrealEngine/blob/55c9f3ba0010e2e483d49a4cd378f36a46601fad/Engine/Source/Runtime/Engine/Classes/Engine/EngineTypes.h#L581)

Or use less invasive option and use one of 18 custom collision channels from ECC\_GameTraceChannel1 - ECC\_GameTraceChannel18. Editor settings give you option to name them for blueprint and property lists views:

> **[Add a Custom Object Type to Your Project](https://docs.unrealengine.com/5.1/en-US/add-a-custom-object-type-to-your-project-in-unreal-engine/)**
>
> How To add a custom physics object channel to Unreal Engine.

You can check them up in defult configs to make sure they have right number assign, here example from template:

[https://github.com/EpicGames/UnrealEngine/blob/55c9f3ba0010e2e483d49a4cd378f36a46601fad/Templates/TP\_FirstPerson/Config/DefaultEngine.ini#L2](https://github.com/EpicGames/UnrealEngine/blob/55c9f3ba0010e2e483d49a4cd378f36a46601fad/Templates/TP_FirstPerson/Config/DefaultEngine.ini#L2)

For C++ you can use this small macro hack in one of your main header file to make more natural name:

```
#define EEC_NameOfChannel EEC_GameTraceChannel1

```

---

<div class="post-metadata">

**Author:** ![Ambience\_Lee](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ambience\_Lee](https://forums.unrealengine.com/u/Ambience_Lee)\
**Post date:** [December 5, 2016, 5:42pm UTC](https://forums.unrealengine.com/t/how-can-i-create-custom-collision-object-type-and-make-it-avaliable-in-c/378315/3 "2016-12-05T17:42:56Z")

</div>

thanks, but the first link you give me has 404 page not found issue ☹

---

<div class="post-metadata">

**Author:** ![DennyR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DennyR](https://forums.unrealengine.com/u/DennyR)\
**Post date:** [December 5, 2016, 7:08pm UTC](https://forums.unrealengine.com/t/how-can-i-create-custom-collision-object-type-and-make-it-avaliable-in-c/378315/4 "2016-12-05T19:08:56Z")

</div>

Yes you can, you have to set up a collision profile in the config that uses this type and then just call [SetCollisionProfileName(FName Name)](https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Components/UPrimitiveComponent/SetCollisionProfileName/index.html)

That should do it.

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [December 5, 2016, 8:07pm UTC](https://forums.unrealengine.com/t/how-can-i-create-custom-collision-object-type-and-make-it-avaliable-in-c/378315/5 "2016-12-05T20:07:14Z")

</div>

Thats because you need to tie your github account with ue4 account to get access to engine source code there. follow first 2 sections there:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...
