![]() |
Help Obi 7 disable simulation - 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 Obi 7 disable simulation (/thread-4471.html) |
Obi 7 disable simulation - natko1412 - 27-03-2025 Hi, in Obi6 I could disable simulation, but still have rendering done by not running code in custom Updater. How would I do this in new version? This was my updater before: Code: using UnityEngine; RE: Obi 7 disable simulation - josemendez - 27-03-2025 Hi, You can set the solver's maxStepsPerFrame to zero. This will disable simulation entirely, but keep rendering on. kind regards, RE: Obi 7 disable simulation - natko1412 - 27-03-2025 (27-03-2025, 01:08 PM)positionsjosemendez Wrote: Hi, Thank you. Will it still update the rendering if I am setting particle positions in code? RE: Obi 7 disable simulation - josemendez - 27-03-2025 (27-03-2025, 01:32 PM)natko1412 Wrote: Thank you. Will it still update the rendering if I am setting particle positions in code? Yes, since they won't be overwritten by the simulation. RE: Obi 7 disable simulation - natko1412 - 27-03-2025 (27-03-2025, 01:45 PM)josemendez Wrote: Yes, since they won't be overwritten by the simulation. I am using Compute backend. In my server app, the simulation is running and everything is fine. On my client, I am setting the positions and velocities like this: Code: for (int i = 0; i < positions.Count; ++i) RE: Obi 7 disable simulation - josemendez - 27-03-2025 (27-03-2025, 05:49 PM)natko1412 Wrote: I am using Compute backend. Hi! Positions and velocities are read back from the GPU at the end of each simulation step, and uploaded to the GPU at the start of the next step as per the manual: Quote:Obi will automatically upload particle data to the GPU at the start of every simulation step (only those data lists that have been modified by the CPU since the last time they were uploaded). You’ve disabled simulation by setting the maximum amount of steps per frame to zero, so they won’t be automatically sent to the GPU. You must send them manually. Call the Upload() method on both the positions and velocities solver arrays after your for loop to do so. Kind regards, RE: Obi 7 disable simulation - natko1412 - 28-03-2025 Thank you, that makes sense! Now I'm still struggling to get it working. I think the problem might be in changing length of the rope. I am sending the changes and calling cursor.ChangeLength(deltaLen) on the client side, but it seems nothing happens. I suppose it is the same thing as in documentation it says that the length is changed at next solver update. What could be the workaround? Maybe to manually activate particles as they get activated on the server side ? EDIT. All working now, thanks for help. |