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

So I created an Object type in the project settings, it’s name is Item.
I try to define it inside of c++ code:

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?



You either need to add them here by modifying engine:

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:

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

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

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

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)

That should do it.

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: