Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Independent Timescale
#1
Is there a way to make Obi Rope use an independent timescale? I'm slowing down Timescale in my game for a slow-motion effect but I want my rope to continue resolving at full-speed. Thanks!
Reply
#2
(07-08-2017, 08:27 PM)momothemonster Wrote: Is there a way to make Obi Rope use an independent timescale? I'm slowing down Timescale in my game for a slow-motion effect but I want my rope to continue resolving at full-speed. Thanks!

Hi!

The simulation step for the solver is done by solver.SimulateStep(deltaTime); This is usually called in FixedUpdate(), WaitForFixedUpdate() or LateUpdate(), depending on your solver settings. 

If you're using the default settings (FixedUpdate) then you can slightly modify ObiSolver.cs to achieve what you want: In its FixedUpdate() method, instead of passing Time.fixedDeltaTime to SimulateStep(), pass your own custom delta time.

cheers!
Reply
#3
Thanks for the quick reply! I've switched to using LateUpdate and I do:

Code:
smoothDelta = Mathf.Lerp(Time.unscaledDeltaTime,smoothDelta,0.95f);

instead of

Code:
smoothDelta = Mathf.Lerp(Time.deltaTime,smoothDelta,0.95f);

It would be fantastic if we could set this via the inspector in the future so we could update to new versions of Obi Rope without clobbering this fix.
Reply