Obi Rigidbody Bug - Doesn't Come To Rest - 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: Obi Rigidbody Bug - Doesn't Come To Rest (/thread-3466.html) |
Obi Rigidbody Bug - Doesn't Come To Rest - obiropequestion - 23-05-2022 Hi, I'm running into an issue when using an obi rope and a rigidbody with an obi collider. As long as a rope is active in the same scene, the rigidbody's speed and velocity doesn't come to 0. Here are two videos showing this in action: Imgur Video Album
Edit: I'm using Unity 2020.3.11f1, standard render pipeline. I set up a new project with only ObiRope imported, added a single chain, and cube with a rigidbody + obi collider and ran into the same issue. RE: Obi Rigidbody Bug - Doesn't Come To Rest - josemendez - 24-05-2022 (23-05-2022, 09:43 PM)obiropequestion Wrote: Hi, Hi Alex, This is a known issue in Unity that we've reported several times in the past to no avail: when assigning zero velocity to a rigidbody (or the exact same velocity it currently has), it prevents the rigidbody from going to sleep and its velocity never actually reaches zero. Additionally if a rigidbody is asleep, assigning zero velocity to it will wake it up. Obi's simulation loop roughly looks like this: - Read the rigidbodies' current velocity. - Perform simulation using this velocity data, and modify it if needed (Obi actor collides with or is attached to a rigidbody) - Write back the -perhaps modified- velocity for each rigidbody. Even when the rigidbody velocity is zero or very close to zero and it isn't modified by Obi, just calling the velocity setter for the rigidbody will prevent velocity from reaching zero and the rigidbody won't go to sleep. To workaround that, open up ObiRigidbody.cs file and modify the UpdateVelocities method (at the very bottom of the file) to look like this: Code: public override void UpdateVelocities(Vector3 linearDelta, Vector3 angularDelta) This will skip writing velocities back if they're very small, which isn't ideal but will work around the issue. RE: Obi Rigidbody Bug - Doesn't Come To Rest - obiropequestion - 24-05-2022 Thank you, this solves the problem for me. |