Search Unity

Mesh Collider for Point Cache Mesh

Discussion in 'Scripting' started by Lisi, Apr 8, 2014.

  1. Lisi

    Lisi

    Joined:
    Apr 8, 2014
    Posts:
    22
    Hi!
    I have the following problem: I have a mesh with a point cache animation. I have written a script that reads the point cache file. The animation works fine, but the mesh collider is always the same (from the original mesh without animation). Is there a possibility to change the mesh collider also like the vertices of the mesh?

    Best regards,
    Elisabeth
     
  2. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    Set the sharedMesh member of the MeshCollider to null and then set it to your mesh.
     
  3. Lisi

    Lisi

    Joined:
    Apr 8, 2014
    Posts:
    22
    Thanks a lot. That works :)