Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  [FIXED] Rope Lagging Behind Attachment
#1
Hi, long term Obi user since 3.0. I just got back into it using 6 and I noticed the rope will lag behind its attached rigidbody where it wouldnt in past versions.

Here is the imgur that contains the settings and gif of the rope lagging behind: https://imgur.com/a/DokBjAl

EDIT:
Unity 2020.3.3.0f1 LTS
Obi v6.4

Movement (physics):
Code:
private void FixedUpdate()
{
    Vector3 forcePoint = transform.position + transform.TransformDirection(moveForceOffset);
    Rigidbody.AddForceAtPosition(_targetForce, forcePoint, ForceMode.Force);
}
Reply
#2
Hi!

Check that the rope isn't colliding against the balloon, as collisions might be forcing the rope out of it. See the last bit of:
http://obi.virtualmethodstudio.com/manua...aints.html

If that's the cause (hard to tell from the gif alone, I can't tell if the distance between the balloon and the rope changes as it moves or if it's just a parallax effect), the solution is simple: filter out collisions between the tip of the rope and the balloon. Note collision filtering has changed quite a lot since Obi 3.0, the old "phases" system has been since replaced with a much more versatile filtering system, see "collision filtering" in the "collisions" page:http://obi.virtualmethodstudio.com/manual/6.3/collisions.html
Reply
#3
Thanks for the tips, Jose! I went ahead and applied the masks / cats so no collisions would happen between the balloon and the rope but still no dice. 

From my perspective it seems the rope is updating after physics step. I tried various tweaks like changing the solver to after Fixed Update and some pin constraint tweaking but still nothing. 

Here is a gif of it with Obi 5, I did not have any problems with pins that I can think of in that version. 

I sent a PM to you through here that will have the project .zip if you want to see it for yourself  Sonrisa

EDIT:
Forgot Obi 5 video link - https://i.imgur.com/tWkaDW1.mp4
Reply
#4
Hi!

Thanks for sharing your project! thanks to it I was able to identify the issue: it's a problem with interpolation (doesn't happen when both solver and rigidbody interpolation are off). Luckily it's easy to fix: open up ObiFixedUpdater.cs and move line 67 to the top of the function, like this:

Quote:private void Update()
{
accumulatedTime += Time.deltaTime;

ObiProfiler.EnableProfiler();
Interpolate(Time.fixedDeltaTime, accumulatedTime);
 ObiProfiler.DisableProfiler();
}

The time passed to the Interpolate() function was one frame behind the actual time, resulting in attachments to interpolated rigidbodies lagging behind. Accumulating the frame time before passing it to the function is the right thing to do. Will include this fix in the next update.
Reply
#5
(09-03-2022, 09:21 AM)josemendez Wrote: Hi!

Thanks for sharing your project! thanks to it I was able to identify the issue: it's a problem with interpolation (doesn't happen when both solver and rigidbody interpolation are off). Luckily it's easy to fix: open up ObiFixedUpdater.cs and move line 67 to the top of the function, like this:


The time passed to the Interpolate() function was one frame behind the actual time, resulting in attachments to interpolated rigidbodies lagging behind. Accumulating the frame time before passing it to the function is the right thing to do. Will include this fix in the next update.

Thanks for the fast fix! I went ahead and applied it and works perfectly   Gran sonrisa
Reply