Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question How to Reset the Cloth during Runtime?

Discussion in 'Physics' started by makaka-org, Aug 21, 2023.

  1. makaka-org

    makaka-org

    Joined:
    Dec 1, 2013
    Posts:
    909
    In Unity 2022.3. E.g. after scaling the Game Object.

    I noticed that Unity 2022.2 introduces the next feature:
    • Physics: Improved the performance of the cloth system and parallelized system operations. The cloth system update is split into three stages: skinning, simulation and read-back. Each stage is distributed across multiple jobs and properly represented inside the profiler's timeline. (1173457)
    How to get access to each of these stages?

    P.S. Just updated my Basketball Project from Unity 2021.3 to Unity 2022.3, and the cloth became flattened after the scaling.

    The next example doesn't work anymore:

    Code (CSharp):
    1.  
    2. gameObject.SetActive(false);
    3.  
    4. transform.localPosition = localPositionOnBigSize;
    5. transform.localScale = localScaleOnBigSize;
    6.  
    7. gameObject.SetActive(true);
    ----------------------------------
    Unity 2021.3 - Correct Behavior:



    ----------------------------------
    Unity 2022.3 - Wrong Behavior:


    1.png 2.png
     
    Last edited: Aug 21, 2023
  2. makaka-org

    makaka-org

    Joined:
    Dec 1, 2013
    Posts:
    909