Search Unity

Interactive Cloth one frame behind

Discussion in 'Editor & General Support' started by obviousjim, Mar 4, 2011.

  1. obviousjim

    obviousjim

    Joined:
    Oct 11, 2009
    Posts:
    29
    We have flags on flag poles being moved around on boats. The flag poles have colliders on them and the flags have interactive cloth.

    When the flags get moved fast on their boats, the cloth simulation always seems to be about one frame behind - which makes them disconnect from their poles.

    Is there a way to specify the vertices are always touching? or do we need to move the colliders in something other than Update()?

    thanks!
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    did you ensure to move and handle the boat only in fixed update?
    cause cloth as any physical object is only updated with fixed update, not basing on rendering frames (update / lateupdate)
     
  3. obviousjim

    obviousjim

    Joined:
    Oct 11, 2009
    Posts:
    29
    ahh perfect! by taking the flag out of the hierarchy and moving it explicitly during FixedUpdate it worked.

    Thanks!