16-08-2018, 11:37 AM
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)!
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);
}