Problem with Line Trace and Instanced Static Mesh Components. The first attempt fails

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); 

image

Checklist for debugging:

  1. Check collision preset: Does your mesh has the correct Object type and profile (see screenshot)
  2. Check collision shape: Does your mesh has a simple collision (On the static mesh: show simple collision)
  3. Check trace: Is your trace really passing through the mesh
  4. Check C++ code: Is bTraceComplex is false and CollisionChannel on a correct channel
1 Like