Search Issue Tracker

By Design

Votes

3

Found in

4.3.1f1

Issue ID

578605

Regression

No

Unable to update to meshcollider with skinnedmeshrenderer and BlendShapes.

Physics

-

To reproduce:
1. Open testPlugin project
2. Open testBlendShapes scene
3. Press play
4. Move around sliders

Expected result: Mesh collider updates correctly
Actual result: Mesh collider stays the same

Resolved by design: The SkinnedMeshRenderer is, as it's name applies, a Renderer. It applies some deformations to the mesh data as it is rendering. However, it does not modify the original mesh asset. For that reason, other components using that Mesh (such as a MeshCollider) will not see any changes on the mesh from the skinning.

It is possible to achieve what you want using the BakeMesh method on the SkinnedMeshRenderer, which stores the skinning results into a Mesh asset:

http://docs.unity3d.com/ScriptReference/SkinnedMeshRenderer.BakeMesh.html

However, I would suggest looking for another way to solve the problem you are trying to solve, as, even if this works, updating MeshCollider meshes in real time is pretty slow, as the physics engine needs to rebake collision data it handles for each MeshCollider each time the mesh changes, which is a slow process.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.