Obi Official Forum
Help Relocating rope/solver in scene breaks it - 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 Relocating rope/solver in scene breaks it (/thread-3544.html)



Relocating rope/solver in scene breaks it - dhymers - 30-07-2022

Hi All,

I've made a scene using 5 obi ropes and it works pretty well, I planned to make it a prefab or copy it to other scenes  to use throughout a unity game, but one of the solvers/ropes stops working even if I simply try and move it to a new location in the scene it was constructed in. I'd like to use this setup at least 5 or 6 times throughout a game and I'd love to not have to rebuild it every time. Is this a common bug ?

Thanks
Dave
[attachment=1442]


RE: Relocating rope/solver in scene breaks it - josemendez - 01-08-2022

(30-07-2022, 09:18 PM)dhymers Wrote: Hi All,

I've made a scene using 5 obi ropes and it works pretty well, I planned to make it a prefab or copy it to other scenes  to use throughout a unity game, but one of the solvers/ropes stops working even if I simply try and move it to a new location in the scene it was constructed in. I'd like to use this setup at least 5 or 6 times throughout a game and I'd love to not have to rebuild it every time. Is this a common bug ?

Thanks
Dave

Hi Dave,

Never heard of a similar issue. Placing the solver in a new location in the scene should not prevent it from running. As long as the actor is below the solver's hierarchy, and the solver has been added to a updater component, it should run fine.

Would it be possible for you to share your scene/project by sending it to support(at)virtualmethodstudio.com so that I can take a closer look? thanks!


RE: Relocating rope/solver in scene breaks it - dhymers - 03-08-2022

ok thankyou, I hope this link and the package work ok, I've never exported a single scene as a package.

https://drive.google.com/file/d/11xS1eVB7mG0o_wyyCQrHHBhEaJ6nKIh8/view?usp=sharing


RE: Relocating rope/solver in scene breaks it - josemendez - 04-08-2022

Hi!

Took a look at the package, but I'm not too sure what I should try/test in the scene. Seems to work fine for me.


I guess you're moving one of the solvers outside the main camera's frustum, and since it has "Simulate when invisible" disabled, it just stops simulating because it's not visible anymore. This option is enabled by default and should only be disabled for eye candy stuff that can just be skipped if you're not looking directly at it, so you must have disabled it by accident. See:
http://obi.virtualmethodstudio.com/manual/6.3/obisolver.html

As a side note: having multiple solvers for spatially close ropes doesn't make too much sense. If the ropes are part of the same simulation, simulated in the same vector space, and under the same global forces (damping, gravity, inertia, etc) there's no point in having multiple solvers and they should be managed by the same solver.

Moreover, each one of your solvers has its own ObiFixedUpdater component, one of them updates both solvers while the other one updates only 1 solver. This is not only wrong (one of the solvers is being updated twice per frame) but also unnecessarily slow since it negates any multithreading benefits: your solvers will be updated sequentially, instead of updated concurrently. In computers with more than 1 core/thread, this will be twice as slow.

Unless you want to update separate solvers at different points during the frame (for instance, some solvers in FixedUpdate() and others in LateUpdate()) you should only have one updater in your scene, in charge of updating all solvers. This is much simpler and also a lot faster, since all solvers will be updated in parallel. See:
http://obi.virtualmethodstudio.com/manual/6.3/updaters.html


RE: Relocating rope/solver in scene breaks it - dhymers - 05-08-2022

Gracias Jose!

I overlooked the do not sim when not visible option and that was the problem, so simple, sorry for the trouble.

I also took your advice and tidied up the solver / fixed updater issue, I was experimenting and got very confused. Thanks for all your hard work on this plugin!
Dave


RE: Relocating rope/solver in scene breaks it - josemendez - 05-08-2022

You're welcome! (de nada!) Sonrisa let me know if I can be of further help.