Help Dynamic attachment - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html) +--- Thread: Help Dynamic attachment (/thread-2886.html) |
Dynamic attachment - Caduceus - 23-04-2021 Hello I have next rope: [attachment=978] Here is Settings of rope: Here is settings of Balls: I want to drag a rope using red ball and yellow ball. Rope must NOT changing a length. But result is so: [attachment=976] [attachment=977] 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: [attachment=979] How I can create hard link between attachment and rope? RE: Dynamic attachment - josemendez - 23-04-2021 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/tutorials/pinconstraints.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! RE: Dynamic attachment - Caduceus - 23-04-2021 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() 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 RE: Dynamic attachment - josemendez - 23-04-2021 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. |