How to assign mesh collider to rigidbody?

I’m trying to make a game where the player’s character model changes. I’m thinking the way to do this is make the player an empty game object and put all of the possible models inside it. Then only render the model of interest.

I’ve given my empty gameobject a rigid body and all model character models have a mesh collider. The docs say the rigidbody uses colliders to detect collision, but they don’t mention how to assign a collider to a rigidbody.

I’m thinking when I change the model of interest, I’ll also change the collider that the rigidbody points to, but I can’t find a way of doing this assignment.

A rigidbody uses the collider that is attached to the same GameObject, and any colliders that are on its childeren that don’t also have a rigidbody on them. Remember that mesh colliders can’t collide with terrains or other meshes unless they are set to ‘convex’- this might also contribute to your problem. I would recommend just using a primitive collider that is vaguely the shape of your characters on the base rigidbody, and then just not having colliders on any of the children. How important is it that the collider exactly fits the mesh? Remember that colliders on skinned meshes don’t animate with the mesh.

I think I should be able to use primitive colliders for most of my character’s forms. But if rigidbodies use the colliders of all its children, I think I’m going to need to be able to swap my player gameobject’s children in and out so the correct collider is always used.

Let’s say my player goes from standing to ducking, the ducking mesh will of course be different and need a smaller collider.