Obi Official Forum
Help Roll rope/chain around object - 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 Roll rope/chain around object (/thread-3673.html)



Roll rope/chain around object - Samadhi - 29-11-2022

Hello, everyone!

I wanted to do a chain that rolls around a tube/pipe but I'm having a hard time thinking how to achieve it.

So far I have set a chain. One end is attached to a fixed point and the other end is attached to a point that rolls around the tube.

The tube has an obi collider and the chain reacts to it. It actually wraps itself around the tube but it sometimes stutters or just jumps randomly. Do you have any idea why that might be?
Like so:


Also, for explaining purposes I removed two blocks in the vide above. Those blocks are meant to prevent the chain from just sliding out of the tube. But when they are there, the chain has a hard time trying to do a second "layer" and, instead, jumps randomly as it collides with itself.

It seems that removing ant gravity makes it less "jittery" but I need the chain to have gravity.

And for an extra, when the chain does stay rolled around the tube, it seems to be a small gap between them. Is there a way to reduce it?

Some extra information, my obi rope version is 6.5, my unity version is 2021.3.8f1, and the solver in charge of the chain only has the constraints of distance, particle collision / queries, collision, and chain active with 8 sequential iterations (except chain which only has a 3) and the default relaxation of 1.

Thanks in advance.

As a reference, the point that circles around the tube, does so through animation like this:



RE: Roll rope/chain around object - josemendez - 30-11-2022

(29-11-2022, 08:58 PM)Samadhi Wrote: The tube has an obi collider and the chain reacts to it. It actually wraps itself around the tube but it sometimes stutters or just jumps randomly. Do you have any idea why that might be?
As a reference, the point that circles around the tube, does so through animation

Hi!

Any animation that must interact with a physical simulation must have its update mode set to "Animate Physics". Otherwise the simulation and the animation are updated out of sync and may result in a lot of weird issues. See:
https://docs.unity3d.com/Manual/class-Animator.html

(29-11-2022, 08:58 PM)Samadhi Wrote: And for an extra, when the chain does stay rolled around the tube, it seems to be a small gap between them. Is there a way to reduce it?

This means the actual particles used to simulate the chain are a bit bigger than your chain links. Just make the links bigger (or the rope thinner). You can easily visualize the particles by adding a ObiParticleRenderer component to your rope.


(29-11-2022, 08:58 PM)Samadhi Wrote: Some extra information, my obi rope version is 6.5, my unity version is 2021.3.8f1, and the solver in charge of the chain only has the constraints of distance, particle collision / queries, collision, and chain active with 8 sequential iterations (except chain which only has a 3) and the default relaxation of 1.

Chain constraints don't have anything to do with chain rendering. See: http://obi.virtualmethodstudio.com/manual/6.3/chainconstraints.html

These settings are working against you, making the chain more stretchy than it should be and wasting performance on constraints that aren't being used. Deactivate chain constraints, set all constraint iterations to 1 and increase the amount of substeps you're using to 8-10 (you'll find substeps in the ObiFixedUpdater component).

kind regards,