Help I want to put an object to sleep - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html) +--- Thread: Help I want to put an object to sleep (/thread-3076.html) |
I want to put an object to sleep - moyashiking - 20-08-2021 I have an object that I put to sleep using a script. Collider, Rigidbody, Obi Collider, Obi RigidBody have been added. When I place the Obi Emitter in a remote location (eg 10000m) and play it, the object's Sleep is instantly released. Sleep is enabled by removing the object's Obi Collider, Obi RigidBody, or by removing the Obi Emitter. Isn't the object to which Obi Collider and Obi RigidBody added become Sleep? RE: I want to put an object to sleep - josemendez - 24-08-2021 (20-08-2021, 06:42 AM)moyashiking Wrote: I have an object that I put to sleep using a script. Collider, Rigidbody, Obi Collider, Obi RigidBody have been added. Hi, This is a known bug in Unity: setting the velocity of an object will keep it awake, even if the change in velocity is zero. Internally, Obi sets the velocity of all objects involved in the simulation, preventing them from sleeping. A hacky workaround to this is to modify the UpdateVelocities method in ObiRigidbody.cs, to check if the velocity change is very small and then avoid modifying it: Quote:public override void UpdateVelocities(Vector3 linearDelta, Vector3 angularDelta) RE: I want to put an object to sleep - moyashiking - 25-08-2021 (24-08-2021, 04:44 PM)josemendez Wrote: Hi,Was it a Unity bug! I will refer to your advice. Thank you very much. |