Constraining object to skinned mesh vertex position,Constraining to mesh vertex
Hi,
I'm working on a tool for a medical simulator that will constrain an object to the closest vertex on a referenced mesh. The tool is suppose to work with a SkinnedMeshRenderer that include both bones and blendshapes influences.
Right now I have it so that the blendshapes are bake and bone weighting captured (via .GetBlendShapeWeight). I also run a comparison that identifies the closest vertex and searches/ stores the same vertex index from a list of bakes blendshape meshes.
My issue now it tying it all back together to give me a lerp result. I'm not sure the best way to take all this information and have a final result that follows one point that also obeys bone and blendshape deformation. I have some promising results when a character is in a standing position but it breaks when the character is in a reclining position.
If anyone cab point me in the right direction, any help would be appreciated.
Your answer
![](https://koobas.hobune.stream/wayback/20220613043536im_/https://answers.unity.com/themes/thub/images/avi.jpg)