2
\$\begingroup\$

I have a chain that is made of connected configurable joints. I used ultimate rope builder for the rope chain creating.

The problem is that when i apply a larger force to the chain, it starts to tear and chain links starts to flicker and move chaotically.

The chain is Idle Force is applied to chain Joint settings

Video available here: https://youtu.be/zGOgk4Ictt0

What could be causing such a behavior ?

\$\endgroup\$
6
\$\begingroup\$

This is an effect of the joint-solver that tries to keep the joints together but fails to do so when big forces are applied.

This occurs frequently when a "rope" consist of a large amount of small individual elements and joints.

Things you could do to improve the behavior:

  • reduce the amount of joints in your rope. Example: Create a physics-chain with only 3 or 4 segments and use a spline-interpolation to calculate positions and angles of your visual chain elements.
  • Create an additional spring-joint from your character to the "ball" to ensure the ball will never be further away from the character than the actual rope length.
  • Sometimes it helps to increase the mass of the rope elements.
  • Increase your "Solver Iteration Count" in the physics-settings.
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Hi, thaks for feedback. I have added my rope settings in my original question. I tried your improvements: - Even with 3 colliders the rope starts to tear. - I atached the head of the flail to the arm with spring joint with enourmour spring force 0 min distance and small max distance. Its still tearing but it behaves little differently. - If I increase the mass, the rope will tear quicker but also moves quicker, it just adds more force to the chain. - I did not see any difference. \$\endgroup\$ – jellyfication May 1 '15 at 12:33
  • \$\begingroup\$ I haven't used rope builder before.. so your rope tears even with 3 links? Have you tried adjusting the mass of your "flail" (eg. reducing it)? \$\endgroup\$ – bummzack May 1 '15 at 12:52
  • \$\begingroup\$ If i reduce the mass of the flail head it moves erraticaly, so then I need to reduce the mass of the rope link, but them the rope is super stiff, when I set the link joint spring to 0, it starts to tear again. Anyway the only thing that prevents the tearing is having high "Link Joint Spring"/"Chain mass" ratio. But then the rope is stiff. \$\endgroup\$ – jellyfication May 1 '15 at 13:21
2
\$\begingroup\$

Exact the same problem as you. Mostly I agree with @bummzack, but not the last one: Increase your "Solver Iteration Count" in the physics-settings. If this number is too large, the problem will get worse!

If you can afford the jittery, you can set this number to 1. Then the solver never fails, but more jittery.

Moreover, here is the official way to keep stability:

  • Avoid small Joint angles of Angular Y Limit and Angular Z Limit. Depending on your setup, the minimum angles should be around 5 to 15 degrees in order to be stable. Instead of using a small angle, try setting the angle to zero. This locks the axis and provide a stable simulation.
  • Uncheck the Joint’s Enable Preprocessing property. Disabling preprocessing can help prevent Joints from separating or moving erratically if they are forced into situations where there is no possible way to satisfy the Joint constraints. This can occur if Rigidbody components connected by Joints are pulled apart by static collision geometry (for example, spawning a Ragdoll partially inside a wall).
  • Under extreme circumstances (such as spawning partially inside a wall or pushed with a large force), the joint solver is unable to keep the Rigidbody components of a Ragdoll together. This can result in stretching. To handle this, enable projection on the Joints using either ConfigurableJoint.projectionMode or CharacterJoint.enableProjection.
  • If Rigidbody components connected with Joints are jittering, open the Physics Manager (Edit > Project Settings > Physics) and try increasing the Default Solver Iterations value to between 10 and 20.
  • If Rigidbody components connected with Joints are not accurately responding to bounces, open the Physics Manager (Edit > Project Settings > Physics) and try increasing the Default Solver Velocity Iterations value to between 10 and 20.
  • Never use direct Transform access with Kinematic Rigidbody components connected by Joints to other Rigidbody components. Doing so skips the step where PhysX computes internal velocities of corresponding Rigidbody components, making the solver provide unwanted results. A common example of bad practice is using direct Transform access in 2D projects to flip characters, by altering Transform.TransformDirection on the root boon of the rig. This behaves much better if you use Rigidbody2D.MovePosition and Rigidbody2D.MoveRotation instead.
  • Avoid large differences in the masses between Rigidbody components connected by Joints. It’s okay to have one Rigidbody with twice as much mass as another, but when one mass is ten times larger than the other, the simulation can become jittery.
  • Try to avoid scaling different from 1 in the Transform containing Rigidbody or the Joint. The scaling might not be robust in all cases.
  • If Rigidbody components are overlapping when inserted into the world, and you cannot avoid the overlap, try lowering the Rigidbody.maxDepenetrationVelocity to make the Rigidbody components exit each other more smoothly.
| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.