Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Obi Rope Pin Constraint One frame behind
#1
Hi, 
I'm using pin constraints to connect my rope to obiColliders on my character and their sword. These colliders are moved around during the characters animation. The simulation seems to work but the whole simulation is one frame behind the animation:
[Image: 0kI8lfc.png]
[Image: oCaC4T6.png]

I assume this is happening because the ObiSolver is updating before the animation but even changing the "Simulation Order" to "Late Update" doesn't fix the problem. 

I also don't think the problem lies with my constraint iterations because if you look closely at the images, the rope is in the correct position but just one frame delayed.

If anyone has any advice or thinks they know why this is happening it would be much appreciated!

If you need more info just let me know Sonrisa
Reply
#2
(05-12-2018, 10:13 PM)CommonFruit Wrote: Hi, 
I'm using pin constraints to connect my rope to obiColliders on my character and their sword. These colliders are moved around during the characters animation. The simulation seems to work but the whole simulation is one frame behind the animation:
[Image: 0kI8lfc.png]
[Image: oCaC4T6.png]

I assume this is happening because the ObiSolver is updating before the animation but even changing the "Simulation Order" to "Late Update" doesn't fix the problem. 

I also don't think the problem lies with my constraint iterations because if you look closely at the images, the rope is in the correct position but just one frame delayed.

If anyone has any advice or thinks they know why this is happening it would be much appreciated!

If you need more info just let me know Sonrisa

Make sure the solver interpolation is disabled. Enabling frame interpolation will delay simulation exactly 1 frame.
Reply
#3
(06-12-2018, 12:05 PM)josemendez Wrote: Make sure the solver interpolation is disabled. Enabling frame interpolation will delay simulation exactly 1 frame.

Solver Interpolation is set to none. I even swapped out my Obi Solver for an a fresh one with default values and the problem persists.
Reply
#4
(06-12-2018, 12:05 PM)josemendez Wrote: Make sure the solver interpolation is disabled. Enabling frame interpolation will delay simulation exactly 1 frame.

Any other suggestions for this one?  Sonrisa
Reply
#5
(23-12-2018, 04:19 AM)CommonFruit Wrote: Any other suggestions for this one?  Sonrisa

What's your update mode for the Animator component?
Reply
#6
(23-12-2018, 07:29 PM)josemendez Wrote: What's your update mode for the Animator component?

The Update mode for the animator component on my player is set to "Normal". I tried changing it to each of the other settings but the problem persists. 

I should also mention I was having a similar issue with a cloth sim I had attached to the player, the cloth would be one frame behind and lag behind the player a bit. This issue, however, was solved by changing the Simulation Order to "Late Update". The rope couldn't be fixed this way unfortunately. Regardless of the Simulation Order, the rope lags behind one frame.
Reply
#7
(24-12-2018, 11:54 PM)CommonFruit Wrote: The Update mode for the animator component on my player is set to "Normal". I tried changing it to each of the other settings but the problem persists. 

I should also mention I was having a similar issue with a cloth sim I had attached to the player, the cloth would be one frame behind and lag behind the player a bit. This issue, however, was solved by changing the Simulation Order to "Late Update". The rope couldn't be fixed this way unfortunately. Regardless of the Simulation Order, the rope lags behind one frame.

Hi,

Try the following: go to ObiActor.cs, and move all the code inside the OnSolverFrameBegin() method to the OnSolverStepBegin() method. Then set the Animator's update mode to Update Physics, and the solver mode to After Fixed Update.

This workaround should work under any circumstances.
Reply
#8
(27-12-2018, 09:49 AM)josemendez Wrote: Hi, 

Try the following: go to ObiActor.cs, and move all the code inside the OnSolverFrameBegin() method to the OnSolverStepBegin() method. Then set the Animator's update mode to Update Physics, and the solver mode to After Fixed Update. 

This workaround should work under any circumstances.
Hi,
First of all I appreciate you sticking with me though all this. I created a test scene to try to help isolate this problem. In my test scene I only have my character with an animator component and a rope that I created using Create->Obi->Obi Rope(fully set up).. I then used 2 pin constraints to attach each end of the rope to obi colliders on her hands. 

In the following image the update mode of my animator is set to "Animate Physics" (I have no Update Physics option). My rope solver update mode is also set to "After Fixed Update" however I've tried all combinations of update modes for the animator and solver and nothing seems to fix the issue. In ObiActor.cs my "OnSolverFrameBegin()" method is completely empty so there's nothing to move to "OnSolverStepBegin()".

[Image: WIaUWlr.png]


To be sure, I disabled all constraints on my Obi Rope except for Distance and Pin. I set both of these to "Sequential" and increased them to 50 iterations in my test scene. This didn't seem to bring the end of the rope any closer to it's pin. In this image you can see the blue dotted line showing the distance between the particle and the pin constraint. Maybe I'm fundamentally misunderstanding the capabilities of the pin constraints but it seems like they're mostly successful but just delayed by a frame for some reason.

This delay on the rope isn't super obvious in real-time, however it's very evident in screenshots and can be noticed in real-time during some attacks/animations. I'd really like to solve this if it's a bug, however if this delay is part of the intended behavior or is created by some technical limitation, maybe there's another work around?

Thanks, Logan
Reply
#9
(07-01-2019, 07:48 PM)CommonFruit Wrote: Hi,
First of all I appreciate you sticking with me though all this. I created a test scene to try to help isolate this problem. In my test scene I only have my character with an animator component and a rope that I created using Create->Obi->Obi Rope(fully set up).. I then used 2 pin constraints to attach each end of the rope to obi colliders on her hands. 

In the following image the update mode of my animator is set to "Animate Physics" (I have no Update Physics option). My rope solver update mode is also set to "After Fixed Update" however I've tried all combinations of update modes for the animator and solver and nothing seems to fix the issue. In ObiActor.cs my "OnSolverFrameBegin()" method is completely empty so there's nothing to move to "OnSolverStepBegin()".

[Image: WIaUWlr.png]


To be sure, I disabled all constraints on my Obi Rope except for Distance and Pin. I set both of these to "Sequential" and increased them to 50 iterations in my test scene. This didn't seem to bring the end of the rope any closer to it's pin. In this image you can see the blue dotted line showing the distance between the particle and the pin constraint. Maybe I'm fundamentally misunderstanding the capabilities of the pin constraints but it seems like they're mostly successful but just delayed by a frame for some reason.

This delay on the rope isn't super obvious in real-time, however it's very evident in screenshots and can be noticed in real-time during some attacks/animations. I'd really like to solve this if it's a bug, however if this delay is part of the intended behavior or is created by some technical limitation, maybe there's another work around?

Thanks, Logan


Hi Logan,

All along I thought you were using fixed particles, not pin constraints. Pin constraints are intended to enable two-way coupling with rigid bodies, and do have a slight delay (since they are reactive, they only act once there's some separation, and they are timestep dependent).

Try using fixed particles/handles instead. They will position the rope particles much more accurately, as instead of using forces to position the particles they use transforms.

See:
http://obi.virtualmethodstudio.com/tutor...ments.html
Reply
#10
(08-01-2019, 09:31 AM)josemendez Wrote: Hi Logan,

All along I thought you were using fixed particles, not pin constraints. Pin constraints are intended to enable two-way coupling with rigid bodies, and do have a slight delay (since they are reactive, they only act once there's some separation, and they are timestep dependent).

Try using fixed particles/handles instead. They will position the rope particles much more accurately, as instead of using forces to position the particles they use transforms.

See:
http://obi.virtualmethodstudio.com/tutor...ments.html

Hi,

This worked. Thank you. I still needed Pin Constraints for a variety of things but I was able to combine the use of Handles and Pin constraints to achieve the result I wanted by swapping back and fourth in different situations. 
I'm having another unrelated issue though but I'll create a separate Thread for that.

Thanks again,
Logan
Reply