Crash when a character overlaps with a physics simulating Geometry Collection Component

The game can crash in UCharacterMovementComponent::CapsuleTouched when the OtherComp parameter is a UGeometryCollectionComponent. In that function it does an unchecked cast to USkinnedMeshComponent*, with the only guard condition being that the OtherBodyIndex parameter isn’t INDEX_NONE, which I suppose is supposed to represent the OtherComp’s overlapped bone index. The issue is that for UGeometryCollectionComponent’s, it’s possible for that OtherBodyIndex parameter to have a value other than INDEX_NONE. I’m not exactly sure why or what that value represents for a geometry collection component, but it fulfills the condition and lets the cast happen, which causes a crash once it tries to call GetBoneName().

Steps to Reproduce
Enable overlaps and physics simulation on a geometry collection component and have the player (or any character in theory) overlap with it.

Thanks Elias, and confirmed on my end. Looks like a regression from 5.7.

Bug raised here, and triaged out to the dev team - https://issues.unrealengine.com/issue/UE\-392989

Best

Geoff Stacey

Developer Relations

EPIC Games