PhysX constraints moving static meshes with fixed constraints

Hello

I’m working on an application in which I spawn a bunch (in this case ~30) of StaticMeshComponents, and then constrain them with physics constraints (fixed, prismatic, etc.). For this, I am using UConstraintComponent. I am seeing some odd behavior when I enable the physics simulation. When the physics simulation is disabled, all of the components spawn in the correct location (see attached Complex.png, noting the location of the two triangles). In the attached images, the red, green, and blue lines represent the local X, Y, and Z axes of the mesh component’s local coordinate system, and they intersect at the origin (which should be the center of the shape).

complex.PNG.jpg

When I enable physics, the components move dramatically, some getting pulled inside the others (see attached simple.PNG). The engine thinks the actors are at the same location, as shown the by the coordinate axes. All of the joints are fixed joints - that is, all degrees of freedom, both angular and linear, are locked. I’ve tried the following to fix it:

  1. Increase the PositionSolverIterationCount and VelocitySolverIterationCount of each BodyInstance for the static meshes to 10,000. This helped with a different problem (“rubber band” joints), but doesn’t seem to do anything for this problem.

  2. Tried setting bSoftConstraint to 0 for the linear, cone, and twist limits in the ProfileInstance. Also increase Stiffness and Restitution to large values. Didn’t seem to do anything.

This might be solved by switching from joints to articulations, but this isn’t natively supported in UE4 as far as I can see, and would require rewriting a large portion of the application. Does anyone else have any ideas on how to fix this issue?