13-05-2021, 03:00 PM
(13-05-2021, 01:27 PM)josemendez Wrote: Hi Vincent,
Disabling the solver would be the best option. This is what the solver does internally when you uncheck "Simulate when invisible": it disables itself when outside of any camera frustum, and re-enables when it is visible.
There should not be much of a spike when disabling/enabling the solver (could not reproduce any spikes in any of our test scenes at least), disabling a solver just stops calling its internal update methods. No initialization or data juggling takes place when enabling/disabling. Could you share a profiler screen capture of said spikes?
Note that if you are using the Burst backend, async JIT compilation is enabled by default in-editor, which means that all jobs will be compiled at runtime when first called. This will result in a large spike when enabling a solver for the first time. You can disable this in Unity's Burst menu. Also, it's disabled in builds.
Thank you for your answer !
So I just gave it a try, here is the profiler with Burst,
And with Oni (which seems much slower somehow ?)
This is in-editor, I'll update you with a build test. By the way here I am disabling the solver Gameobject (so also the ropes that are its children, as well as obi colliders), I was not sure wether you meant the script or the gameobject.
Thanks you