- Home /
Using hinge joints for rope
Hey,
At the moment i have a series of planes set up in a straight line with hinges attached to them. This all works fine. What i'm also doing is i have a collider on the last plane which i can then click on and drag around. When it gets dragged i simply set the position of the gameobject to the worldspace position of the mouse coordinates. This causes all the hinges to react to it and bend around like a 2D rope. The issue is that i can pull the thing apart by moving the last gameobject to quickly and too far away.
Is there a better way to manipulate this without breaking all the constraints of the hinge joints?
Answer by Bicko · Feb 03, 2012 at 11:32 AM
I assume your Break Force/Torque are set to infinity so it'll never break (in theory)? I'd suggest that you Vector3.Lerp the position of the end point towards the mouse point, rather than just snapping it straight-to.. that might fix your problem.
You could also perform a Vector3.Distance to see how far away from the start point the end point currently is, and if it's beyond a certain amount then stop the end point trying to get to the mouse.
That is correct i kept them at infinity since i didnt want them to break at all. I'll attempt to lerp the position ins$$anonymous$$d of snapping it when i get back into work, thanks for the suggestion. Completely forgot about lerping it. I'm actually already doing a distance check between the start and mouse and telling it to "let go" as soon as it exceeds this distance. But even then if you move the mouse quick enough it $$anonymous$$rs apart (then snaps back when you let go again). So yeah, basically to reiterate and recollect my thoughts - i want the rope to act exactly the same way when i physically manipulate it to when it simply simulates with no manipulation. (keep limitations and make them stay together).
Your answer
Follow this Question
Related Questions
Is it possible to make a realistic rope using the interactive cloth? 0 Answers
Hinge Joint not Arcing 0 Answers
Hanging Onto A Rope 0 Answers
Is there any way I can move a hinge joint around the stage? 0 Answers
Grapple and swing/pull mechanic 2 Answers