# ETraceTypeQuery being converted to the wrong ECollisionChannel during line trace

**URL:** <https://forums.unrealengine.com/t/etracetypequery-being-converted-to-the-wrong-ecollisionchannel-during-line-trace/771635>\
**Category:** C++\
**Tags:** UE-5, line-trace, unreal-engine, collision-responses, CPP, question\
**Created:** [February 15, 2023, 8:15pm UTC](https://forums.unrealengine.com/t/etracetypequery-being-converted-to-the-wrong-ecollisionchannel-during-line-trace/771635 "2023-02-15T20:15:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GV-Rafael-III](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GV-Rafael-III](https://forums.unrealengine.com/u/GV-Rafael-III)\
**Post date:** [February 15, 2023, 8:15pm UTC](https://forums.unrealengine.com/t/etracetypequery-being-converted-to-the-wrong-ecollisionchannel-during-line-trace/771635/1 "2023-02-15T20:15:18Z")

</div>

I’m using UKismetSystemLibrary::LineTraceSingle to perform line traces in C++. So far my preference for traces (unless I create a new channel for them) has been ECC\_Visibility, which is supposed to correspond to TraceTypeQuery4.

[Here’s a forum post that first taught me about ETraceTypeQuery.](https://forums.unrealengine.com/t/what-is-etracetypequery/288696)

I had no trouble with this in a previous project, but in my current one UEngineTypes::ConvertToCollisionChannel is converting TraceTypeQuery4 to _ECC\_WorldDynamic_. Very strange. I haven’t changed any of the project’s collision settings whatsoever. Has anybody run into this before? I’m on UE 5.1.1.

---

<div class="post-metadata">

**Author:** ![GV-Rafael-III](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GV-Rafael-III](https://forums.unrealengine.com/u/GV-Rafael-III)\
**Post date:** [February 16, 2023, 1:00am UTC](https://forums.unrealengine.com/t/etracetypequery-being-converted-to-the-wrong-ecollisionchannel-during-line-trace/771635/2 "2023-02-16T01:00:08Z")

</div>

As a follow-up, ECC\_Visibility has been assigned to TraceTypeQuery1 in my current project. Again, this is confusing as the last project I made had ETraceTypeQuery values assigned exactly the way I’d learned…and that project was on UE 5.1.1 as well.

In the previous project, I’d created 2 custom object channels for specific purposes but even then…shouldn’t custom trace/object channels be assigned the higher ETraceTypeQuery values, while the lower values are reserved for the engine’s default channels?

---

<div class="post-metadata">

**Author:** ![Korred1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Korred1](https://forums.unrealengine.com/u/Korred1)\
**Post date:** [March 11, 2024, 9:24am UTC](https://forums.unrealengine.com/t/etracetypequery-being-converted-to-the-wrong-ecollisionchannel-during-line-trace/771635/3 "2024-03-11T09:24:44Z")

</div>

> [@GV-Rafael-III](#):
>
> TraceTypeQuery

I recon you already figured it out, but for anyone to know how ETraceTypeQuery and EObjectTypeQuery map here is piece of code to figure it out

```auto
	for (int32 i = 0; i < ETraceTypeQuery::TraceTypeQuery_MAX; ++i)
	{
		ETraceTypeQuery EnumValue = static_cast<ETraceTypeQuery>(i);
		FString EnumName = UEnum::GetValueAsString(EnumValue);
		FString ChannelName = UEnum::GetValueAsString(UEngineTypes::ConvertToCollisionChannel(static_cast<ETraceTypeQuery>(i)));
		UE_LOG(LogTemp, Log, TEXT("ETraceTypeQuery Name: %s"), *EnumName);
		UE_LOG(LogTemp, Log, TEXT("Collision Channel Name: %s"), *ChannelName);
	}
	for (int32 i = 0; i < EObjectTypeQuery::ObjectTypeQuery_MAX; ++i)
	{
		EObjectTypeQuery EnumValue = static_cast<EObjectTypeQuery>(i);
		FString EnumName = UEnum::GetValueAsString(EnumValue);
		FString ChannelName = UEnum::GetValueAsString(UEngineTypes::ConvertToCollisionChannel(static_cast<EObjectTypeQuery>(i)));
		UE_LOG(LogTemp, Log, TEXT("EObjectTypeQuery Name: %s"), *EnumName);
		UE_LOG(LogTemp, Log, TEXT("Collision Channel Name: %s"), *ChannelName);
	}

```

Custom traces are defined in YourProject/Config/DefaultEngine.ini

```auto
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel2,DefaultResponse=ECR_Ignore,bTraceType=True,bStaticObject=False,Name="Blockable")

```

---

<div class="post-metadata">

**Author:** ![imtrobin2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@imtrobin2](https://forums.unrealengine.com/u/imtrobin2)\
**Post date:** [March 13, 2024, 2:43pm UTC](https://forums.unrealengine.com/t/etracetypequery-being-converted-to-the-wrong-ecollisionchannel-during-line-trace/771635/4 "2024-03-13T14:43:58Z")

</div>

This code does not get custom channel name properly, it just gets ECC\_GaneChannelXX

---

<div class="post-metadata">

**Author:** ![Korred1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Korred1](https://forums.unrealengine.com/u/Korred1)\
**Post date:** [March 13, 2024, 7:32pm UTC](https://forums.unrealengine.com/t/etracetypequery-being-converted-to-the-wrong-ecollisionchannel-during-line-trace/771635/5 "2024-03-13T19:32:37Z")

</div>

that is correct, you have to look into file DefaultEngine.ini to see how channels ECC\_GameTraceChannelX map to your custom channels.

```auto
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel1,DefaultResponse=ECR_Ignore,bTraceType=True,bStaticObject=False,Name="Landscape")
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel2,DefaultResponse=ECR_Ignore,bTraceType=True,bStaticObject=False,Name="Blockable")

```

Reason why i provided given code is that to know how these ETraceTypeQuery map to ECC\_GameTraceChannel, because I scrached my head for a while with theses channels and how they map
