Help How do you properly destroy an Obi 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: Help How do you properly destroy an Obi Rope at runtime? (/thread-810.html) |
How do you properly destroy an Obi Rope at runtime? - SamMcG - 07-01-2019 If I try to destroy a rope simply using Destroy(gameObject), all other ropes using that solver stop working. I've tried using Solver.RemoveActor(rope), but that results in a whole bunch of weird problems. What is the correct way to go about this? RE: How do you properly destroy an Obi Rope at runtime? - SamMcG - 07-01-2019 When I say all other ropes stop working, it seems that they only stop updating visually. Their bounds and other things are still working and moving correctly, its just visually they stop. If any ropes are added after this, or if the bugged rope is clicked in the inspector, it starts rendering correctly again. Edit: Using the particle grid debugger, its definitely just the mesh that isn't updating, the particles are all correct. RE: How do you properly destroy an Obi Rope at runtime? - SamMcG - 15-01-2019 Still looking for a solution to this. I don't know if its a bug with ObiRope or if I'm doing something wrong. RE: How do you properly destroy an Obi Rope at runtime? - josemendez - 15-01-2019 (15-01-2019, 10:38 AM)SamMcG Wrote: Still looking for a solution to this. I don't know if its a bug with ObiRope or if I'm doing something wrong. Hi SamMcG, Testing with Obi 3.5 and Unity 2018.1, I'm unable to reproduce this. Ropes are deleted correctly and all other ropes still render as they should (each rope has its own renderer, and generates its own mesh, apart from sharing the same solver they're completely isolated so I don't see how deleting one rope could affect others). Calling Destroy() is the correct way of destroying any ObiActor, as they remove themselves from the solver they're in automatically upon destruction. This is the code I'm using to test this, in a scene with around 100 short ropes. I populate the "ropes" list with them, and start pressing "A" to destroy each rope. Code: using System.Collections; RE: How do you properly destroy an Obi Rope at runtime? - SamMcG - 16-01-2019 (15-01-2019, 07:41 PM)josemendez Wrote: Hi SamMcG, Thanks for the reply. I've tried reinstalling ObiRope but I still get the same bug. It may have something to do with the way I'm creating the ropes. I've spent a long time trying to figure out what exactly is causing it, but it's so inconsistent I haven't made any progress towards stopping it. When I have time, I'm just going to start from the beginning and rewrite my spawning scripts to hopefully avoid this. |