Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Slowed Simulation Problems
#1
Hello!

I've recently started using ObiCloth to enhance some of my characters' clothing and I'm in the process of integrating my own slo-mo logic into it (as I'm avoiding using Unity's own timescale).

Recently I've been running into a problem with the clothing deforming and "crinkling" during this slo-mo process. You can see this effect in this gif. You can also see the change that I've made to ObiSolver's LateUpdate (as I saw you recommended in a previous thread) posted below.

Any insight into this would be welcome (I'm also having problems with collisions and clipping but that's a separate issue that I'll bugfix later)!

Code:
private void LateUpdate(){

        if (Application.isPlaying && simulationOrder == SimulationOrder.LateUpdate){

               // smooth out timestep and accumulate it:
               if (SlowTimeManager.fTimeScaleGlobal != 0)
               {
                   smoothDelta = Mathf.Lerp(Time.deltaTime / SlowTimeManager.fTimeScaleGlobal, smoothDelta, 0.95f);
               }

               else
               {
                   return;
               }
            
             AccumulateSimulationTime(smoothDelta);
            SimulateStep(smoothDelta);

        }

        if (!Application.isPlaying)
            return;
 
        EndFrame (simulationOrder == SimulationOrder.LateUpdate ? smoothDelta : Time.fixedDeltaTime);

        if (OnFrameEnd != null)
            OnFrameEnd(this,null);
    }
Reply


Messages In This Thread
Slowed Simulation Problems - by Reiffer - 16-08-2018, 11:37 AM
RE: Slowed Simulation Problems - by josemendez - 16-08-2018, 02:50 PM
RE: Slowed Simulation Problems - by Reiffer - 20-08-2018, 10:38 AM