OverlapAnyTest### Collision Tests do not work correctly in 4.22 - 4.25

Since moving from 4.21 to 4.24, we are finding that all OverlapAnyTest### functions never return true under any circumstances.

We have also found that the behaviour of OverlapMultiByProfile() and by extension SceneQuery::GeomOverlapMultiImp() no longer return true in the same test circumstances and have changed from the 4.21 behaviour.

In 4.21, if an overlap was detected and the primitives that overlapped “blocks” the object type of the collision profile, the functions would return true. Now both sides have to “block” each other. This mirrors other collision behaviour so I suspect this is the desired result here.

Just to be sure however, this is our test code that worked in 4.21. The Profile setup here, is that the Wall is set to “Block” the box, and the box is set to “Overlap” the wall. We do not want to use “Block” on any of the boxes collision responses because otherwise this will block all other queries that sweep through that space too.

	TArray<FOverlapResult> Overlaps;
	const bool bAnyBlockingOverlaps = GetWorld()->OverlapMultiByProfile(Overlaps
		, PlacementGuard->GetComponentLocation()
		, PlacementGuard->GetComponentQuat()
		, PlacementGuard->GetCollisionProfileName()
		, PlacementGuard->GetCollisionShape()
		, QParams);

	const bool bAnyBlockingOverlaps = GetWorld()->OverlapAnyTestByProfile(PlacementGuard->GetComponentLocation()
		, PlacementGuard->GetComponentQuat()
		, PlacementGuard->GetCollisionProfileName()
		, PlacementGuard->GetCollisionShape()
		, QParams);

const bool bAnyBlockingOverlaps = GetWorld()->OverlapBlockingTestByProfile(PlacementGuard->GetComponentLocation()
	, PlacementGuard->GetComponentQuat()
	, PlacementGuard->GetCollisionProfileName()
	, PlacementGuard->GetCollisionShape()
	, QParams);

Note that we can restore the original behaviour by doing the following.

	for (const FOverlapResult& OverlapItr : Overlaps)
	{
		if (OverlapItr.GetComponent())
		{
			const bool OverlapBlocksGhost = OverlapItr.GetComponent()->GetCollisionResponseToChannel(PlacementGuard->GetCollisionObjectType()) == ECR_Block;
		}
	}

However - it appears as though OverlapAnyTestByProfile() doesn’t actually return true under any circumstances. This appears to have been the case since 4.22, so I’m surprised nobody else has run into this yet.

The issue is that FGenericPhysicsInterface::GeomOverlapAnyTest() just returns the result of FGenericPhysicsInterface::GeomOverlapMultiImp() - which only returns true for blocks, not overlaps. I can’t compare to the 4.21 code because SceneQuery.cpp did not exist in that version of the engine.

The “Fixed” code for GeomOverlapAnyTest is to change Line 641 of SceneQuery.cpp:

GeomOverlapMultiImp<EQueryInfo::GatherAll>(World, Adaptor.GetGeometry(), CollisionShape, Adaptor.GetGeomPose(GeomTransform.GetTranslation()), Overlaps, TraceChannel, Params, ResponseParams, ObjectParams);
return Overlaps.Num() != 0;