Obi Official Forum
Restart rope at runtime - 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: Restart rope at runtime (/thread-418.html)



Restart rope at runtime - leonrdo - 27-02-2018

My question is about restart the rope simulation at runtime. I'm trying to restart the rope to its initial state (pooled particles count, path, used particles, etc.) at runtime.
Is there a method or way to restart the simulation via script?


RE: Restart rope at runtime - josemendez - 01-03-2018

(27-02-2018, 08:54 PM)leonrdo Wrote: My question is about restart the rope simulation at runtime. I'm trying to restart the rope to its initial state (pooled particles count, path, used particles, etc.) at runtime.
Is there a method or way to restart the simulation via script?

Hi there,

To reset particle positions, velocities, etc, call rope.Reset().

Note this won't reset the rope's length (store the starting length somewhere and call cursor.SetLength(startingLength)), or re-glue together torn pieces of rope. If you wish to reset absolutely everything to its starting state, I recommend using prefabs and control this via instantiation.


RE: Restart rope at runtime - leonrdo - 01-03-2018

thanks again Jose!