Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Cloth component not working

Discussion in 'Unity 5 Pre-order Beta' started by Kuothe, Oct 27, 2014.

  1. Kuothe

    Kuothe

    Joined:
    Aug 14, 2013
    Posts:
    18
    As the title says, the Unity 5 Cloth component is not working properly.

    If I add the Cloth component to a skinned mesh, modify it, and save it to a prefab (or apply to an existing one) it won't save the data and lose all changes.



    Here's the Unity project (14 Mbytes) if you want to check it out:
    https://dl.dropboxusercontent.com/u/18941888/testcloth5.unitypackage

    Advice?
     
  2. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    Cloth is broken. I've had a bug in about it since 5b1, so presumably it just hasn't gotten to the top of the priority list yet.
     
    Kuothe likes this.
  3. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    Hopefully it gets addressed soon. The new Cloth solver is one of the Unity 5 features I've been most excited about!
     
    Fab4, hopeful and Kuothe like this.
  4. Kuothe

    Kuothe

    Joined:
    Aug 14, 2013
    Posts:
    18
    Yep, it actually looks really good! The old ClothRenderer had some huge issues with collision detection, performance and 'broken' vertex. It's a shame I can't port my project to Unity 5 because of this bug.
     
  5. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    I'm really looking forward to trying out the new cloth. Unfortunately I probably won't get a chance to for a while.

    Really hope they fix this before then!
     
  6. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    595
    Hi Kuothe,

    This has been already addressed, expect the build with the fix to be available in a week or two.

    Anthony
     
  7. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    Has the crash bug (Case 627107) been fixed as well, or just the data issue? I'm really looking forward to trying the new cloth.
     
  8. Kuothe

    Kuothe

    Joined:
    Aug 14, 2013
    Posts:
    18
    Checked it again in Unity 5 b11 and it still doesn't work, so no upgrade for us.
     
  9. Waz

    Waz

    Joined:
    May 1, 2010
    Posts:
    287
    Having nothing better to do in my porting experiment while waiting for this internal fix to become external, I manually copied the coefficient data from a saved scene before applying the prefab (note: 0 values cause crash, use 0.0001), so finally I could see the new cloth in action.

    Nice.

    The collider approach is much easier to define and seems to work better than cloth did in Unity 3.5. It's been a long wait (and still not over), but it looks like finally my customers will get back fun swishing robes, flapping cloaks, and bouncing hairdos. $600 well spent.
     
    Kuothe likes this.
  10. Kuothe

    Kuothe

    Joined:
    Aug 14, 2013
    Posts:
    18
    Mmm that isn't working for me.. Even if I select ALL nodes and put Max Distance = 1 and then Apply to prefab, it just loses all data. Anything I'm missing? Are you using any custom script or something?

    Btw, congratz on WazHack, I followed development since when you started posting about it on reddit.
     
    Last edited: Nov 6, 2014
  11. Waz

    Waz

    Joined:
    May 1, 2010
    Posts:
    287
    I mean manually as in editing the .prefab text file using the values in the .unity scene file. i.e a complete hack - I just had to know if Cloth was going to make my upgrade worthwhile.
     
  12. Kuothe

    Kuothe

    Joined:
    Aug 14, 2013
    Posts:
    18
    I tried copying the full "Cloth:" text on the scene to the prefab, and also only the m_Coefficients:, but the .prefab always broke or Unity crashed etc.. I think I'll have to wait for the official fix.

    Btw, any news?
     
  13. Waz

    Waz

    Joined:
    May 1, 2010
    Posts:
    287
    Sure enough, 1.5 weeks have passed and beta 12 is out. Downloading...
     
  14. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    B12 still hasn't fixed my issue, but maybe it's Mac only. You've actually been able to run a scene with cloth in it? Is it something you can share?
     
  15. Waz

    Waz

    Joined:
    May 1, 2010
    Posts:
    287
    I can't see your Case 627107 in the issue tracker, so I can't really comment on that.

    The prefab bug (my case 645111, also not shown in issue tracker) is also not fixed. Maybe yant's "has been already addressed" means something other than "fixed". Or the weird 3-rolling-betas-and-2-classes-of-beta-testers thing is biting us.

    All I have managed to do is hack .prefab text files to force cloth coefficients to be set on my character, so as to make it vaguely testable.
     
  16. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    This is now fixed (but not in a release yet). This one took a longer to fix, because it took quite a few cycles between dev and QA to pinpoint it so that we could uniformly reproduce it (it turned out to be a deadlock in PhysX multithreading, which only shows up on certain CPU core configurations).
     
    ecurtz and Kuothe like this.
  17. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Because of our development process, fixes may take several cycles to show up in a beta. Basically, development is done on feature branches, and to get into the current beta, a feature branch will usually go through some rounds of automated testing and code review. Since that process takes some time, developers will not always get their fixes in for each beta release, but might wait a couple of releases so they don't have to go through the process each week.
     
    Kuothe likes this.
  18. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    FYI, here's a list of pending physics bug fix release notes and associated case numbers waiting to go into a beta build:

    Physics: fix a typo in the error message when the stepOffset is invalid 633110
    Physics: fix crash when loading a scene with cloth that has no PhysX cloth object created yet 634383
    Physics: fix for trigger crash when colliders are deactivated from inside of trigger event handlers 632554
    Physics: update mass distribution when the collider is loaded to validate suspension data 619503
    Physics: fix wheel collider to make it ignore triggers 639985
    Physics: Fix scale on cloth 637807
    Physics: Fix memory leak in IgnoreCollision
    Physics: Fix freeze duplicating GameObject with Terrain 633760
    Physics: Make sure Rigidbody wakes up when joint is destroyed 631736
    Physics: Fix potential threading deadlock in cloth simulation 627107
    Physics: Fix OnTriggerExit being called when changing IgnoreCollision for unrelated colliders 643818
    Physics: Fix disabled mesh colliders not being disabled when changing convex flag 639564
    Physics: Fixed a bug where CharacterControllers would incorrectly collide with triggers 634572
    Physics: Fixed a bug where CCD Collisions would return flipped normals 631029
    Physics: Fix storing cloth constrains in prefabs 631860
     
    Josh-Naylor, ecurtz, Kuothe and 2 others like this.
  19. Waz

    Waz

    Joined:
    May 1, 2010
    Posts:
    287
    Thanks, Jonas, this is exactly the kind of openness and information that keeps us out of the scary darkness of the unknown. I'm looking forward to b13/14.
     
    Kuothe and shkar-noori like this.
  20. Kuothe

    Kuothe

    Joined:
    Aug 14, 2013
    Posts:
    18
    Thanks a lot Jonas! Eagerly awaiting b13!
     
  21. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    Excellent Jonas, that one has been bugging me for ages, can't wait to see it in action!