I change one object’s mesh,but I can’t updata the meshColider.
I used the code below , but the collider disappear.
Mesh mesh =gameObject.GetComponent<MeshFilter>();
mesh = blah.blah.blah;
gameObject.Getcomponent<MeshCollider>().mesh = mesh;
I change one object’s mesh,but I can’t updata the meshColider.
I used the code below , but the collider disappear.
Mesh mesh =gameObject.GetComponent<MeshFilter>();
mesh = blah.blah.blah;
gameObject.Getcomponent<MeshCollider>().mesh = mesh;
anybody konw?
I believe that you are looking for the sharedMesh attribute. Update the mesh in one place and it updates. only a thought
This worked in 3.1
mc = gameObject.Getcomponent();
mc.sharedMesh = null;
mc.sharedMesh = mesh;
Thanks everyone.