If move mesh verts, need to reset mesh collider?

If I move some verts on a mesh, that has a mesh collider, do I need to update the collider, or does it automatically adjust. I was going to update the collider by setting it to null, and assigning a new mesh collider.

Also, should I use mesh.optimize ? It is a imported mesh, but I am manipulating the verts, so Im unsure on this.

The best way to know it to test it :slight_smile:

But from what I’ve seen, you have to reset it by reassigning your mesh to the collider like you said.

// pseudo code
meshcollider = null;
meshcollider = myNewMesh

Concerning mesh.optimize as said in the documentation, this can take some time so for real-time performance it doesn’t seems to be good, and not necessary. Your mesh is already loaded, all the vertices are in place and ordered you only move their positions so optimize won’t make much difference.

What mesh.optimize do ?

But again, you need to test the performance because it depends of the context you are using it.

I hope it helped.