# Constraint fails when collider size is changed

**URL:** <https://forums.unrealengine.com/t/constraint-fails-when-collider-size-is-changed/325684>\
**Category:** World Creation\
**Tags:** collider, unreal-engine, constraint, bug-report, question, Blueprint\
**Created:** [July 17, 2015, 11:28pm UTC](https://forums.unrealengine.com/t/constraint-fails-when-collider-size-is-changed/325684 "2015-07-17T23:28:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DevFelix](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DevFelix](https://forums.unrealengine.com/u/DevFelix)\
**Post date:** [July 17, 2015, 11:28pm UTC](https://forums.unrealengine.com/t/constraint-fails-when-collider-size-is-changed/325684/1 "2015-07-17T23:28:32Z")

</div>

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

 ![50609-heightnotchanged.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/4/a/e4a21b89548bce16a2ab482b0a4ac118971a55ff.png)

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

 ![50610-heightchanged.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/2/9/a29acd7ded13ef36d581750613952b7fdfe27006.png)

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

 ![50621-constructionscript.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/d/7/1d70f85c2d0553b86825bed2d134c8774969cdc7.png)

 ![50622-eventgraph.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/b/7/bb7035429bd992636e9d8d2b9d87dc473c6e30e3.png)

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]

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [July 20, 2015, 8:02pm UTC](https://forums.unrealengine.com/t/constraint-fails-when-collider-size-is-changed/325684/2 "2015-07-20T20:02:39Z")

</div>

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
