Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Re-enabling a rope solver makes the rope go crazy
#1
Hi! Using ObiRope 6.3 in Unity and so far it seems to be working great. I am having an issue trying to optimize though. Sorry if this has been addressed before. I checked the FAQ and also the forum and didn't see this specific issue.

I'm trying to turn the solvers off when I don't need them, and then turn them on as needed. Turning them off is fine, but when I turn a solver back on, the rope connected to it acts like it just got hit with a massive amount of physical force and goes flying around, before coming to a rest where it originally was when I first turned the solver off. Is there a way to make it not do this? I want it to not move or react at all when I turn the solver back on.

I'm using the rope in 2D mode, hanging vertically with the top connected to an unmoving object called startAnchor. The bottom of the rope is another object with a Rigidbody2D called endAnchor, and the connection is dynamic (making the rope like a pendulum). The rope seems to move around pretty realistically and I really like what it looks like. I just want to be able to disable it and then re-enable it in script as needed to maximize efficiency.

Thanks!
Reply
#2
(16-12-2021, 07:13 PM)Lazerpants Wrote: when I turn a solver back on, the rope connected to it acts like it just got hit with a massive amount of physical force and goes flying around, before coming to a rest where it originally was when I first turned the solver off. Is there a way to make it not do this? I want it to not move or react at all when I turn the solver back on.

Hi,

You mention a rigidbody is suspended from the rope. If you disable the solver, the rope will cease applying any forces to the rigidbody and it will fall to the ground. When you re-enable the solver the rigidbody will apply an enormous force to the rope (since it is probably down below, far past the rest length of the rope) and this will make the rope go "crazy" for a few seconds.

If you disable the solver or the rope, you need to disable any rigidbodies interacting with it too. Otherwise when you re-enable the rope, other objects might have moved far from the intended position/state and the solver will have to apply very large forces to both the rope and the rigidbodies to try and get them back into place.

let me know if you need further help. cheers!
Reply
#3
(17-12-2021, 08:26 AM)josemendez Wrote: Hi,

You mention a rigidbody is suspended from the rope. If you disable the solver, the rope will cease applying any forces to the rigidbody and it will fall to the ground. When you re-enable the solver the rigidbody will apply an enormous force to the rope (since it is probably down below, far past the rest length of the rope) and this will make the rope go "crazy" for a few seconds.

If you disable the solver or the rope, you need to disable any rigidbodies interacting with it too. Otherwise when you re-enable the rope, other objects might have moved far from the intended position/state and the solver will have to apply very large forces to both the rope and the rigidbodies to try and get them back into place.

let me know if you need further help. cheers!

Ohh I understand now. I didn't realize turning the solver off would make the rigidbody fall away, and then have to be "yanked" all the way back when the solver gets turned back on. Makes perfect sense. I have it working now. Thank you so much, this is exactly what I needed. You're the best! :-)
Reply