Need to move a Mesh Collider to fit a mesh


I need to create a collider for a model but I cant figure out how to move the collider to be on the mesh.

Is this for an animated character or a ragdoll? Because a mesh collider will not work for that. If it is for an animated character, you can either give it a single capsule collider that roughly fits the size and shape of the entire character, or you can give every body part its own collider.

If it is for a ragdoll, there is a tool for that: Unity - Manual: Ragdoll physics

Maybe you can also use the colliders that are generated by the ragdoll tool for an animated character. but the question is, what exactly you want to achieve and what kind of collider you need for that.

1 Like

Hey, I would have liked to respond earlier but the unity site appears to be unresponsive a lot. Regardless, for an animated character in an FPS, I would need an accurate hitbox, so a capsule wouldn’t work. And even if I did use a ragdoll collider, I assume I can’t customize it at all (there would be a lot of this particular character and I would like it to be as resource
efficient as possible).
How could I do something like TF2 hitboxes? I’m aware its made in a separate game engine but I would like to replicate it for my game

It can certainly be done in Unity, but you’ll probably need two separate types of collider, one for movement, which usually should be a single capsule, and a different type for hit detection (which should not collide with anything else). Of the second type, you’ll need one per moving body part, similarly to a ragdoll, but without the joints and rigidbodies. Just attach a box or capsule collider to each “bone” (transform) that needs one. Make sure to expose them in the Rig import settings, if “Optimize Game Objects” is checked.

1 Like