Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reset Rope Length without Physics
#1
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.
Reply
#2
(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,
Reply
#3
(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.
Reply