Obi Official Forum
Reset Rope Length without Physics - 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: Reset Rope Length without Physics (/thread-4033.html)



Reset Rope Length without Physics - vrtraining - 17-10-2023

We have developed a very detailed crane hook and rope system to lift and drop objects. Now there are some situations in our app where we want everything to reset that includes reseting the rope length, hook positions attached to ropes and other objects. Currently we reload Unity scene which is not effective. 

Now we are trying a full reset of the setup that includes resetting the rope lengths and the positions of their static and dynamic attachments particle points. When we try to reset the rope length instead of instantly going to initial length, it simulates the full physics of rope dragging the hook along with it. How we can disable physics and reset the whole length and setup back to its initial position.


RE: Reset Rope Length without Physics - josemendez - 17-10-2023

(17-10-2023, 05:33 AM)vrtraining Wrote: Now we are trying a full reset of the setup that includes resetting the rope lengths and the positions of their static and dynamic attachments particle points. When we try to reset the rope length instead of instantly going to initial length, it simulates the full physics of rope dragging the hook along with it. How we can disable physics and reset the whole length and setup back to its initial position.

Hi,

You can remove the rope from the solver, clear its state, then add it back:

Code:
rope.RemoveFromSolver();
rope.ClearState();
rope.AddToSolver();

This will reset the rope to the state defined by its blueprint.

kind regards,


RE: Reset Rope Length without Physics - vrtraining - 17-10-2023

(17-10-2023, 06:28 AM)josemendez Wrote: Hi,

You can remove the rope from the solver, clear its state, then add it back:

Code:
rope.RemoveFromSolver();
rope.ClearState();
rope.AddToSolver();

This will reset the rope to the state defined by its blueprint.

kind regards,


Thank you for the quick response. I have tried it and it looks good so far.