Help Re-enabling a rope solver makes the rope go crazy - 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 Re-enabling a rope solver makes the rope go crazy (/thread-3234.html) |
Re-enabling a rope solver makes the rope go crazy - Lazerpants - 16-12-2021 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! RE: Re-enabling a rope solver makes the rope go crazy - josemendez - 17-12-2021 (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! RE: Re-enabling a rope solver makes the rope go crazy - Lazerpants - 17-12-2021 (17-12-2021, 08:26 AM)josemendez Wrote: Hi, 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! :-) |