Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Rope position delay from parent
#7
(16-05-2018, 02:11 PM)josemendez Wrote: In Unity, the order of events is the following:

- FixedUpdate (0, 1, or more times)
- Animation update
- WaitForFixedUpdate (After Fixed Update in Obi)
- Update (just once)

So if you are moving the object in Fixed Update(), setting the solver update order to "After Late Update" should ensure simulation happens after the object has been translated.

Edit: Also, ObiSolver exposes lots of C# events that are called at particular times during the simulation loop. OnStepBegin, OnStepEnd, OnBeforePositionInterpolation,OnFixedParticlesUpdated... etc. You could insert your code in a delegate to be called during OnStepBegin, which is triggered every FixedUpdate just before starting the simulation step. This way you could still use Fixed Update simulation order.

I had it simulate after fixed update at first but when i started pinning physics objects to it, the objects would not react.
[Image: 1uEV6j1.gif]


And I would assign that function to the event like this?
Code:
private void Start()
   {
       solver.OnStepBegin += Move;
   }
Reply


Messages In This Thread
RE: Rope position delay from parent - by cubrman - 15-05-2018, 08:02 PM
RE: Rope position delay from parent - by VirtualCucumber - 16-05-2018, 04:05 PM