Deform Mesh Collider with a Joint

How can a mesh collider deform using a joint when the joint is moved from within Unity and not via imported animations? This is not for anything animation intensive, only a single, simple adjustment once every few seconds.

Thanks!!!

You generally do not animate mesh colliders, because doing so is very slow. Use compound primitive colliders instead.

–Eric

I don’t want to animate hardly at all during run time, but only adjust it once every few seconds.

Thanks again!!!

I would like to use mesh colliders… but addressing your suggestion, can corner “vertices” (or their equivalent) in compound primitive colliders share influences, as vertices can do with joints? Like a box deforming into a parallelogram, a diamond, etc.?

Nope, because then it would basically be a mesh collider, not a primitive collider.

In that case, it’s quite reasonable. But there isn’t currently a way to read the actual vertex positions of skinned meshes from the graphics card, so there’s no real way to use that as an animated mesh collider, unfortunately.

You can still have a dynamic mesh collider, but it requires you to not use skinned meshes, and alter the mesh geometry yourself using the Mesh class.

–Eric

Would “altering the [mesh collider] geometry in the Mesh class” require me to, in effect, reproduce the bone and skin information in Unity code (creating a skeleton and skinning geometry to it) that I can do visually, via tools and while referring to dozens of video tutorials in Maya? If so… crap :frowning: but thank you :slight_smile: Eric for your super fast responses!!! This is already a nice coding adventure for me – it took me 5 hours just to figure out how to tinker in Xcode so iPhone apps can have a space between words without causing a build error (FYI its in teh “Target”)!!! :sweat_smile: :wink: I will tinker with other ways before I dig into the Mesh class.

thanks!!!

Yeah, pretty much. See the “sculpt vertices” example in here for a way of having a dynamic mesh collider.

–Eric