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:
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

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

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:

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

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: