![]() |
Help Rope pinned to two dynamic attachments has a gap when physics act upon it - 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 Rope pinned to two dynamic attachments has a gap when physics act upon it (/thread-4490.html) |
Rope pinned to two dynamic attachments has a gap when physics act upon it - Crimson1462 - 05-05-2025 Hi! I'm new to Obi Rope and just wanted to say—it's a fantastic asset. I really appreciate the craftsmanship behind it. I think I'm running into a user error and could use some help troubleshooting. I’ve attached three images below, in addition, here is a link to a video of the problem. Each of the plugs in my setup are Obi Rigidbodies connected to the rope using dynamic attachments. I believe I’ve set up the constraints correctly for my use case, and I’ve experimented with different iteration and substep values. I’ve also tested different mass settings—for example, setting the rope and rigidbodies both to 0.1, or the rope at 0.1 and the rigidbodies at 1.0, and vice versa—but the issue still occurs. Here’s what I’m hoping to figure out:
Thanks so much in advance! RE: Rope pinned to two dynamic attachments has a gap when physics act upon it - josemendez - 09-05-2025 (05-05-2025, 07:34 PM)Crimson1462 Wrote: Hi! I'm new to Obi Rope and just wanted to say—it's a fantastic asset. I really appreciate the craftsmanship behind it. Hi! How are you moving the rigidbodies around? Would it be possible for you to share any custom code related to this? gaps in pin constraints are often the result of either improper rigidbody movement or physics state interpolation issues. In can see in your screenshot that the solver has interpolation enabled, this will cause a 1-frame delay in simulation. If your rigidbodies aren't using interpolation as well, this may be the cause of the gap. Here’s what I’m hoping to figure out: (05-05-2025, 07:34 PM)Crimson1462 Wrote: If the gaps are unavoidable due to physics constraints, is there a way to reset the rope when it’s stretched beyond a certain threshold? There should be little or no gap. See some of the sample scenes using dynamic attachments ("Crane" or "SpringRod" for instance). In any case, what exactly do you mean by "resetting" the rope when stretched beyond a threshold? You can calculate the amount of strain in the rope like this: Code: float strain = rope.CalculateLength() / rope.restLength; This is the quotient between the rope's current length - including any stretching - and the length it's supposed to have at rest. Strain will have a value of 1 when the rope is not stretched, >1 when stretched, and <1 when compressed. You can react to its value and take action if needed. kind regards, RE: Rope pinned to two dynamic attachments has a gap when physics act upon it - Crimson1462 - 09-05-2025 (09-05-2025, 08:10 AM)josemendez Wrote: Hi! Hi Jose, Thanks for the reply! I'm moving the rigidbodies using VR hand tracking—specifically, the user grabs a “Grabbable” Rigidbody that’s attached to the rope at both ends. When they move (e.g., float away in zero gravity), the plug is pulled with them, and all physics from the VR rig apply directly to the object. Interpolation is enabled on the Rigidbody as well. I’ve reviewed the sample scenes you mentioned (like "Crane" and "SpringRod"), and they work great. I suspect the issue arises from the unique forces introduced by direct hand movement in VR, which might be pulling the dynamic attachments apart in a way that standard interaction doesn’t. Regarding the rope “reset” idea—I was referring to a potential fallback: if the rope is stretched beyond a certain threshold, I could either (1) force it to retract or (2) force the user to drop the object. I’m leaning toward the latter and plan to try that based on the strain value. I can give that a shot based on the strain calculation you provided. Thanks again for the guidance—and I’ve PM’d you the code I’m using for grabbing and the XR rig. I just implemented a script that forces the user to "let go" of the object when excessive strain is detected. It works to some extent, but it's still a bit buggy—for example, if the user picks up the rope too quickly and the plug swings downward, it can falsely trigger the drop event. So while it’s a good starting point, I still need a better visual handling method to avoid gaps in the rope when it’s pulled. |