Overlap detection while inside an object?

I’ve noticed that performing a SweepSingleByChannel using a capsule CollisionShape will fail to detect a hit if the center of the capsule is inside an object that would normally generate a hit.


This is a top-down view of a test cylinder and a few test capsules; the green capsules have detected no overlaps, and the red capsules have detected at least one.


This is a perspective view of the same situation, and you can clearly see that the green capsule is inside the cylinder, but it has not registered an overlap or hit.

https://github.com/icannotfly/icnfrpg/blob/development/icnfrpgSpawnVolume.cpp#L217
Here’s the relevant code. It’s a little dirty.

Does anyone know what’s going on here?

My end goal is to define a brush volume in which players can spawn at a random point. Spawning players inside objects like the cylinder pushes them through the terrain and causes them to fall out of the map, which is obviously not a desired outcome. If there’s a better way to achieve this outcome that I’m missing, feel free to let me know.