Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Dynamic attachment
#1
Hello

I have next rope:

   

Here is Settings of rope:

[Image: 2.png]

Here is settings of Balls:

[Image: 3.png]

I want to drag a rope using red ball and yellow ball. Rope must NOT changing a length.

But result is so:

   

   

What I doing wrong?

Sorry for big images.

I research what in your Chain demo you setup Phase on end point of chain to zero.
I put 0 for Phase in my rope end points and this is particullary help.

But there are still distance if I drag end of rope. Look:

   

How I can create hard link between attachment and rope?
Reply
#2
You're attaching the rope too close to the collider. If you add a ObiParticleRenderer to the rope, the reason for this will become obvious: the colliders are pushing the rope out, even though it's attached to them.

This situation along with the solution (which is to simply disable collisions between the offending particles and the colliders using phases, as you discovered) are described at the end of this page:
http://obi.virtualmethodstudio.com/tutor...aints.html

-------
The gap in the last image you posted can be due to the fact that input is normally updated after physics (Update() is called after FixedUpdate()). This will result in a 1-frame delay that can cause gaps. The solution is to store input and apply it during the solver's step, in the next frame.

Also, large mass ratios between the rope and rigidbodies attached to it (eg, a heavy object attached to a light rope, or the other way around) can require more pin constraint iterations for attachments to  appear stiff enough.

let me know if you need help. cheers!
Reply
#3
Thank you very much for your reply!

I calculate new position of dragging object in OnMouseDrag() function. And run coroutine for next frame as you say:

Code:
void OnMouseDrag()
{

//  calculate new postion    

StartCoroutine(PosFix());

}

IEnumerator PosFix()
{
    yield return new WaitForEndOfFrame();
    if (rigBod && needChangePos)
       rigBod.MovePosition(newPosition);
    yield return null;
}

But this is not help.

And other question - why in your Chain demo you attaching TWO last control points to ball? I disabled second attachment to ball - and did not saw a difference.

I enabled "isKinematic"  during dragging - and this is help. But not sure what this is good solution
Reply
#4
What's the mass of your rigidbody, and the mass of each rope particle?

(23-04-2021, 09:08 AM)Caduceus Wrote: And other question - why in your Chain demo you attaching TWO last control points to ball? I disabled second attachment to ball - and did not saw a difference.

Attaching two points allows you to remove degrees of freedom (DOFs): attaching just one particle results in a ball/socket type attachment with 3 rotational DOFs. This allows the chain to rotate around the attachment point, which is not desired in this case.

By attaching two particles you remove 2 out of the 3 rotational DOFs, and the rope sticks out straight.
Reply