2
\$\begingroup\$

I use hinge joint 2D components to create my rope, and a distance joint to connect it to a moving platform.

On the moving platform I have a distance joint that connects to the first chain joint, so that allows the platform to move, and the rope should follow it.

The problem is that when I move the platform the joint connection will break and joints go crazy. Is there any solution for that?

Rope of hinge jointed circles

When I move the circle, all the joints go crazy:

Broken rope

\$\endgroup\$
2
  • \$\begingroup\$ Do you want a purely visual effect from this rope, or does it need to actually affect the physics movement of the objects it's connected to? \$\endgroup\$
    – DMGregory
    Commented Feb 23, 2017 at 22:51
  • \$\begingroup\$ You need to move it using forces and not directly manipulating its position. Otherwise you are totally messing up the physics calculations. \$\endgroup\$
    – jgallant
    Commented Feb 23, 2017 at 22:51

2 Answers 2

1
\$\begingroup\$

The problem was I was moving the platform by its transform, not a rigidbody.

Instead, I found I should use rigidbody.velocity = dir or just rigidbody.addForce(dir)

Make sure that max force and max torque are set to infinity for each hinge joint - I'm not sure if this is needed for a distance joint.

\$\endgroup\$
2
  • \$\begingroup\$ yup with addForce everything works PERFECT ! \$\endgroup\$
    – Tynio
    Commented Feb 24, 2017 at 9:30
  • \$\begingroup\$ You should consider registering. This will allow you to do more stuff on the site here. After that, please go to this page to have your accounts merged. You'll be able to comment on your own questions and their answers. \$\endgroup\$
    – Vaillancourt
    Commented Feb 24, 2017 at 12:33
0
\$\begingroup\$

To me it looks like you're using way too many joints for it to work smoothly.

Anyway, to solve the joint breaking problem...

Take a look at their properties, there's a max force and a max torque value you can set to infinity so it will never break.

Again, this might help with the problem you described, but I'm afraid this might be the wrong direction for most rope animations.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .