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.