i get hundreds of IsFinite(outDistanceAlongView) / IsFinite(outDistanceForSort) errors when I exit the "Options" Menu with "Esc"... but only when i exit it (entering the menu / the overall game works fine)... which freezes the game...
is this a bug or could this be my fault? any ideas? thanks!
Comments
It has to do with the way Interactive Cloth behaves when the game is paused. Somehow it continues moving when the timeScale is set to 0 (thus pausing the game) and when un-pausing the game, the location is different than before pausing, which confuses the hell out of the game engine and can even crash your project.
The solution is either waiting until Unity finally fixes their interactive cloth (probably in Unity 5), or using the following script that I wrote. Simply apply this JavaSctipt to all your objects using Interactive Cloth and you should be fine
#pragma strict
function Update(){
if( Time.timeScale == 0 ){
if( this.GetComponent(InteractiveCloth).enabled == true )
{
this.GetComponent(InteractiveCloth).enabled = false;
}
}
else{
if( this.GetComponent(InteractiveCloth).enabled == false )
{
this.GetComponent(InteractiveCloth).enabled = true;
}
}
}