Why does SweepSingleByChannel not work with a Box?

FCollisionShape StructureCollision = StructureMesh->GetCollisionShape();

FHitResult Hit; 
    
FVector CollisionLocation;
CollisionLocation = GetActorLocation();
CollisionLocation.Z += StructureCollision.GetBox().Z;
    
bool bHasHit = GetWorld()->SweepSingleByChannel(Hit, CollisionLocation, CollisionLocation, FQuat::Identity, ECollisionChannel::ECC_GameTraceChannel2, StructureCollision); //<--
    
DrawDebugBox(GetWorld(), CollisionLocation, StructureCollision.GetExtent(), (bHasHit ? FColor::Green : FColor::Red), true, 5.f);

What I am expecting: When StructureMesh (Static Mesh) is overlapping with another actor in the scene that respons to the appropriate channel (and this code is called) the debug box should be green.

What happens instead: The debug box does not turn green and therefore no hit results are generated.
But replacing

bool bHasHit = GetWorld()->SweepSingleByChannel(Hit, CollisionLocation, CollisionLocation, FQuat::Identity, ECollisionChannel::ECC_GameTraceChannel2, StructureCollision);

with

bool bHasHit = GetWorld()->SweepSingleByChannel(Hit, CollisionLocation, CollisionLocation, FQuat::Identity, ECollisionChannel::ECC_GameTraceChannel2, FCollisionShape::MakeSphere(300.f));

does lead to the debug color turning green.

Note: Using FCollisionShape::MakeBox(300.f, 300.f, 300.f) doesn’t work either.

How can I fix this?

I think box collision is working now (4.17), I have made some testing with foliage collision and it seems to be working.

I have used blueprint as a workaround for this. In 4.17. I haven’t encountered it so far.

start and end location need to be different. add a small increment (0.001f) to the Z-axis on the start location, and then set that as the end. good luck

It actually worked for me

You are my savior. I have been trying to figure out for weeks, why sweep with box would not work.