- Home /
Question by
wyatts · May 29, 2019 at 07:44 PM ·
mesh colliderconvexdynamic mesh
Dynamic convex mesh collider not working until moved in the editor
I'm creating a dynamic mesh collider that updates every frame. The issue is that the collider doesn't seem to enable until I move it in the inspector. Any idea why it's not enabled the frame the dynamic mesh is assigned?
Comment
Best Answer
Answer by wyatts · May 29, 2019 at 10:00 PM
Apparently every frame you update the collider you need to set it to null first
// on new frame clear collider
GetComponent<MeshCollider>().sharedMesh = null;
// do your stuff to change mesh
// set new mesh to collider
GetComponent<MeshCollider>().sharedMesh = newSharedMesh;
Your answer
![](https://koobas.hobune.stream/wayback/20220612202318im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Use blender to turn on Mesh Collider Convex 0 Answers
Convex mesh collider thinks model is non manifold but it isn't 1 Answer
Object with more than 255 polygons (with Mesh Collider(Convex - on)) is falling through a Terrain 2 Answers
Concave Trigger on Mesh 1 Answer
Prevent lag/delay when enabling mesh collider (convex) 1 Answer