Wow Thanks! Indeed it worked in my case.
Symptoms: some of my static mesh (turn out to be instances) were not colliding with the LineTrace.
With bTraceComplex = false, it now works.
My setup :
ECollisionChannel const CollisionChannel = ECollisionChannel::ECC_Visibility;
FHitResult HitResult;
FCollisionQueryParams CollisionQueryParams = FCollisionQueryParams::DefaultQueryParam;
CollisionQueryParams.bTraceComplex = false;
bool const bHit = World->LineTraceSingleByChannel(HitResult, Start, End, CollisionChannel, CollisionQueryParams);
Checklist for debugging:
- Check collision preset: Does your mesh has the correct Object type and profile (see screenshot)
- Check collision shape: Does your mesh has a simple collision (On the static mesh: show simple collision)
- Check trace: Is your trace really passing through the mesh
- Check C++ code: Is bTraceComplex is false and CollisionChannel on a correct channel