Constraint fails when collider size is changed

Version 4.8.2

The setup consists of two capsule colliders that are constrained together, they overlap at the tips but the joint is set so that they ignore collision between them. This works fine and the expected result is seen below

However, attempting to change the height of one of the capsules results in this

Suddenly they collide with each other and the limits are no longer in effect, they can travel as far away from each other as they want. The joint hasn’t broken from what I can tell since OnConstraintBroken is never triggered, the red and blue lines that should connect to the joint are still there but they no longer connect to the joint. Messing around with constraint settings, motors and different limits etc also gives some behavior.

The issue isn’t limited to capsules, I’ve had the same issue with a box-capsule setup. Here are the blueprints I’ve used for the capsule-capsule setup

I took a quick peek at the source and found this section

void UCapsuleComponent::SetCapsuleSize(float NewRadius, float NewHalfHeight, bool bUpdateOverlaps)
{
	CapsuleHalfHeight = FMath::Max(NewHalfHeight, NewRadius);
	CapsuleRadius = NewRadius;
	MarkRenderStateDirty();

	// do this if already created
	// otherwise, it hasn't been really created yet
	if (bPhysicsStateCreated)
	{
		DestroyPhysicsState();
		UpdateBodySetup();
		CreatePhysicsState();

		if ( bUpdateOverlaps && IsCollisionEnabled() && GetOwner() )
		{
			UpdateOverlaps();
		}
	}
}

It feels like the destruction and recreation of the physics state could be the villain, but that is just my guess. Maybe this is something that was not supposed to work in the first place.

Link for simple test project [ConstraintError_2][5]

Hi DevFelix,

Thank you for the report and the test project. I have entered JIRA UE-18893 into our system for this issue. Our developers will be investigating it further and we may post back here with questions or comments.

As for a workaround, you can try using custom collision channels for the capsules.

Cheers,

TJ