# What is ETraceTypeQuery

**URL:** <https://forums.unrealengine.com/t/what-is-etracetypequery/288696>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [July 19, 2014, 8:24pm UTC](https://forums.unrealengine.com/t/what-is-etracetypequery/288696 "2014-07-19T20:24:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Snipe3000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Snipe3000](https://forums.unrealengine.com/u/Snipe3000)\
**Post date:** [July 19, 2014, 8:24pm UTC](https://forums.unrealengine.com/t/what-is-etracetypequery/288696/1 "2014-07-19T20:24:39Z")

</div>

Does anyone know what the ETraceTypeQuery is? Its a type that is passed into functions such as GetHitResultAtScreenPosition and GetHitResultUnderCursorByChannel, but I’m not sure what it is.  
I’m using the previously mentioned functions to make a character look at the mouse in a top-down shooter. The problem is when the mouse moves over an obstacle it interferes with the direction the character faces. I was hoping the ETraceTypeQuery could solve this issue, just not sure how to use it.

Here is the code that I have:

```
void ALaserTagPlayerController::RotateToMouseCursor() 
{
	FHitResult Hit;
	//The two lines below have the same effect
	//GetHitResultUnderCursorByChannel(TraceTypeQuery1, false, Hit);
	GetHitResultAtScreenPosition(Cast<ULocalPlayer>(Player)->ViewportClient->GetMousePosition(), TraceTypeQuery1, true, Hit);
	const FVector PlayerPos = GetWorld()->GetFirstPlayerController()->GetCharacter()->GetActorLocation();
	FRotator PlayerRot = FRotationMatrix::MakeFromX(Hit.Location - PlayerPos).Rotator();
	PlayerRot.Pitch = 0.0f;
	this->GetCharacter()->SetActorRotation(PlayerRot);
}

```

Thanks

---

<div class="post-metadata">

**Author:** ![Anonymous\_8dc3e8e080079e83cb9b94d4315e0a79](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_8dc3e8e080079e83cb9b94d4315e0a79](https://forums.unrealengine.com/u/Anonymous_8dc3e8e080079e83cb9b94d4315e0a79)\
**Post date:** [May 4, 2019, 2:03pm UTC](https://forums.unrealengine.com/t/what-is-etracetypequery/288696/2 "2019-05-04T14:03:49Z")

</div>

Hello, in the 4.22.1 version, you can view the source code of the

> UKismetSystemLibrary::LineTraceSingle()

function. In the first line,

> ECollisionChannel CollisionChannel =  
> UEngineTypes::ConvertToCollisionChannel(TraceChannel);  
> ConvertToCollisionChannel()

This function converts the enumeration value. To the corresponding

> ECollisionChannel

, for example ETraceTypeQuery I use the second TraceTypeQuery2, then the corresponding ECollisionChannel is

> ECC\_WorldDynamic  
> UMETA(DisplayName=“WorldDynamic”)

, which is the second one.

---

<div class="post-metadata">

**Author:** ![jr557](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jr557](https://forums.unrealengine.com/u/jr557)\
**Post date:** [June 11, 2026, 2:47am UTC](https://forums.unrealengine.com/t/what-is-etracetypequery/288696/3 "2026-06-11T02:47:22Z")

</div>

I believe you just need to call **UEngineTypes::ConvertToTraceType()** which will return a value of type **ETraceTypeQuery** :

`ETraceTypeQuery TraceChannel = UEngineTypes::ConvertToTraceType(ECC_Visibility);`

You can also use this for your custom collision channels like this:

```auto
#define COLLISION_WEAPON ECC_GameTraceChannel1

ETraceTypeQuery TraceChannel = UEngineTypes::ConvertToTraceType(COLLISION_WEAPON);

```
