21-12-2020, 01:38 PM
(21-12-2020, 01:34 PM)josemendez Wrote: You just have to keep Unity's update order in mind.
Physics (including cloth) are updated in FixedUpdate() by default, which is called before Update(). Make sure you're moving the hand at the start of FixedUpdate(), or you will introduce a 1-frame delay. Typically, you'd use Update() or LateUpdate() to move the hand, but that's too late as physics have already been updated that frame. See:https://docs.unity3d.com/Manual/ExecutionOrder.html
For convenience, you can subscribe to solver.BeginStep event and move the hand there. This event is called right before cloth physics are updated, so you don't have to worry about your script's FixedUpdate() being called before/after the solver's FixedUpdate().
Previously i was using unity cloth to do the same thing, and i didn't notice this happening then, does obi solve in a different order to defult unity cloth?