LineTraceSingleByChannel filter not working correctly

So, I’m trying to perform a line trace in some C++ code to detect walls, which must have the WorldStatic collision response. However, it seems that LineTraceSingleByChannel is invariably returning a collision with my player actor, despite having the filter set to WorldStatic and the player using Pawn collision response.

Here’s the code I’m using:

GetWorld()->LineTraceSingleByChannel(wallHit, GetActorLocation(), GetActorLocation() + (direction * 50), ECollisionChannel::ECC_WorldStatic)

But this is always returning a collision against my character actor, even though the filter should prevent it from doing so.

Can anyone tell me what I’m doing wrong, and point me to a solution that would allow me to use this function correctly.

As it turns out, I was using the wrong function. LineTraceSingleByChannel runs the trace for objects that respond to a given channel, while LineTraceSingleByObjectType seems to do what I was looking for. Oops.