How to convert ECollisionChannel to EObjectTypeQuery?

I did it this way, but I got an error

UCollisionProfile CollisionProfile;
TArray<TEnumAsByte<EObjectTypeQuery>> ObjectTypes = { CollisionProfile.ConvertToObjectType(OBJECT_CHANNEL_FLOOR) }; // #define OBEJCT_CHANNEL_FLOOR ECC_GameTraceChannel1
FHitResult MouseHitResult;
GetHitResultUnderCursorForObjects(ObjectTypes, true, MouseHitResult);

Error:
error LNK2019: unresolved external symbol β€œ__declspec(dllimport) public: virtual __cdecl UDeveloperSettings::~UDeveloperSettings(void)” (_imp??1UDeveloperSettings@@UEAA@XZ) referenced in function β€œpublic: virtual __cdecl UCollisionProfile::~UCollisionProfile(void)”

The ofiicial UDeveloperSettings document document cant be opened either. 404 NOT FOUND
Did I not load a module?

Use this function:

TArray<TEnumAsByte<EObjectTypeQuery>> ObjectTypes = { UEngineTypes::ConvertToObjectType(OBJECT_CHANNEL_FLOOR) };
FHitResult MouseHitResult;
GetHitResultUnderCursorForObjects(ObjectTypes, true, MouseHitResult);
1 Like

Thanks.
I solved my problem.
just need to change it to UCollisionProfile::Get()->ConvertToObjectType();