Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Cloth physics constraints

Discussion in 'Physics' started by Timescar, Nov 15, 2015.

  1. Timescar

    Timescar

    Joined:
    Oct 7, 2015
    Posts:
    11
    Hi there,
    I am working on a project where I require to have many clothes on one of the scenes, the problem is the models I have do not have any bone to help me with creating easy constraints when applying cloth physics on them.
    So I tried adding constraints to them but because of the amount of cloths the fps drops and I have performance issues, for that I thought of enabling the cloth physics only when needed for one piece at a time so I only have cloth physics enabled for one object only.
    Apparently though just disabling the cloth component does not make any performance improvement, it has to be removed and applied again.
    My problem for doing that are the constraint points, which will be lost if I remove it :(.

    I am a beginner with unity, so if anyone can tell me a different approach or has a workaround, I would greatly appreciate it :)!
     
  2. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    Are you sure, then doing component.enabled = false does not save performance, by taking cloth out of calculations? What about making clothObject.setActive(false)?
     
  3. Timescar

    Timescar

    Joined:
    Oct 7, 2015
    Posts:
    11
    Setting clothObject.setActive(false) does work.