- Home /
Question by
kyanberu · Aug 30, 2018 at 09:02 AM ·
collidermeshcolliderblendshapes
Mesh collider does not change in blend shape
hi. I am experimenting with a blend shape, but changing the blend shape does not change the size of the mesh collider. Does anyone know the means to change the size of the mesh collider when changing the blend shape? Thanks a lot guys
Comment
Answer by kyanberu · Sep 03, 2018 at 09:16 AM
We have solved the problem.
We were able to update meshCollider by using SkinnedMeshRenderer.BakeMesh ().
var render = GetComponent<SkinnedMeshRenderer>();
render.SetBlendShapeWeight(0,100f);
Mesh bakeMesh = new Mesh();
skinnedMeshRenderer.BakeMesh(bakeMesh);
var collider = GetComponent<MeshCollider>();
collider.sharedMesh = bakeMesh;
this is god sent, i thank you very much. This is a life saving solution. Thanks a lot.
Your answer

Follow this Question
Related Questions
Problem with colliders going through platforms 2 Answers
Problem with colliders 2 Answers
2D collider wont collide with mesh 0 Answers
Mesh Collider not colliding 1 Answer