Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Interactive Cloths makes the scene lagg and freeze

Discussion in 'Editor & General Support' started by SanderAKALego, Nov 27, 2010.

  1. SanderAKALego

    SanderAKALego

    Joined:
    Jul 17, 2010
    Posts:
    32
    For some reason the cloths makes the scene lagg, sometimes freeze, they also disappear.

    I found out that the Interactive cloths made the scene lagg. But i dont know why. I know that cloths can be demanding, but this is ridiculous.

    I have a HD4670 and Pentium E5500 3.5GHz

    so it shouldnt lagg (since it actually worked on a school computer with a 1 core CPU and integrated GPU)

    Ive also tried on a different scene, no lagg but the cloth disappears.

    So i hope some of u can help me :/
     
  2. arioch82

    arioch82

    Joined:
    Dec 3, 2009
    Posts:
    253
    same problem here... tried to add an interactive cloth to the scene (gameobject --> create other --> cloth) and when I hit play everything just freeze...

    edit: i found out that the problem is Time.timeScale... if you set it to 0.0 with an interactive cloth into the scene it will freeze, with values between 0.0f and 1.0f it'll lag a lot!

    are you modifying the time scale too?

    looks like a unity bug...
     
    Last edited: Dec 1, 2010
  3. arioch82

    arioch82

    Joined:
    Dec 3, 2009
    Posts:
    253
    any official answer to this?

    I tried it in an empty scene and I have seen that changing the fixedDeltaTime too accordingly to the timeScale works without freezing the game with a timeScale<1.0f but still when you set it to 0 the cloth will just crash and a list of infinite errors appear in the log...

    Basically is not possible to pause the game with an interactive cloth in the scene...
     
  4. br0kenp0ly

    br0kenp0ly

    Joined:
    Jun 3, 2008
    Posts:
    481
    Hi there!

    I`ve never had any of these problems on any of my computers, so if you could send me a simple testscene, I could test it and maybe talk to some of the "cloth-developers" here.

    Cheers,

    Roald
     
  5. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    There have been a number of threads posted by folks who have had issues with the interactive cloth feature. I did some experiments and found that if I kept the poly count of the mesh to less than 100 polys, the cloth worked fairly well on my i5 with nVidia GTS360M. The low poly cloth cut my framerates nearly in half but it still ran acceptably. It appears that the PhysX functionality has only been partially implemented and that it still has some issues. It's also been reported that interactive cloth only uses a single core, so further explaining why performance is so poor.
     
  6. arioch82

    arioch82

    Joined:
    Dec 3, 2009
    Posts:
    253
    hi,
    I think it's useless to send a scene, to test it I've simply created an empty scene with two object, a cloth (GameObject->Create Other->Cloth, without modifying any cloth's parameter) and a sphere (GameObject->Create Other->Sphere) a bit scaled up to match the cloth size (so around 5.0f but shouldn't matter) so that the cloth will fall on the sphere following just the gravity.

    I've attached this test script to the sphere

    Code (csharp):
    1.  
    2. var time_scale : float = 1.0f;
    3. var change_phy : bool = true;
    4.  
    5. private var start_phy_time : float;
    6.  
    7. function Start(){
    8.     start_phy_time = Time.fixedDeltaTime;
    9. }
    10.  
    11. function Update () {
    12.     if (time_scale<0.0f)
    13.         time_scale = 0.0f;
    14.    
    15.     Time.timeScale = time_scale;
    16.     if (change_phy)
    17.         Time.fixedDeltaTime = start_phy_time * time_scale;
    18. }
    modifying the parameter at runtime you can see that is ok with a different time scale if you change the fixedDeltaTime too but as soon as you set 0.0f the cloth will crash (disappear from the scene, the object is still there but is not rendered) and a list of errors will appear in the console.

    also sometimes it won't crash when you set it to 0 at runtime but you will have the same crash if you'll then set a value >0 again (without stopping the player)
    this happens mainly (but not only) if you set the "time_scale" to a very low value (like 0.01) before hitting play.
     
    Last edited: Dec 2, 2010
  7. SarperS

    SarperS

    Joined:
    Mar 10, 2009
    Posts:
    824
    I'm also having this problem in my game. Any news?
     
  8. matteopallottola

    matteopallottola

    Joined:
    Apr 30, 2023
    Posts:
    1
    ok i'm making a game with bad graphics. and if i plays too long it freeze the game.i don't now this reason.and i not have saved.