Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Relocating rope/solver in scene breaks it
#1
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
   
Reply
#2
(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!
Reply
#3
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/11xS1eVB...sp=sharing
Reply
#4
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/manua...olver.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/manua...aters.html
Reply
#5
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
Reply
#6
You're welcome! (de nada!) Sonrisa let me know if I can be of further help.
Reply