Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    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.