21-06-2023, 01:59 PM
(21-06-2023, 06:59 AM)josemendez Wrote: Hi!
Physics in Unity (including rope physics) are updated in FixedUpdate(), which takes place before Update(). See:
https://docs.unity3d.com/Manual/ExecutionOrder.html
If you move the effector in Update(), you're moving it after the rope has been updated. This means there will always be a 1-frame delay in the position of the rope relative to the effector, since the rope has no chance to update the attachment position until the next FixedUpdate() if you move the effector in Update().
You must move the effector before physics are updated. You can do this easily by subscribing to the solver's OnBeginStep event: http://obi.virtualmethodstudio.com/manua...olver.html
kind regards,
Ok, thanks.
So upon further inspection i think the issue for me is that (since the effector has a renderer) the particle attachment of the rope, tied to the connector, is slightly behind the effector position, or the renderering itslef, of the rope is slightly behind.
Assuming I am moving my effector in FixedUpdate, is there a way I can speed up the particle attachemnt, in tracing the pos of the effector?