- Home /
Mesh collider does not move with ragdoll
I'd like to begin by saying I have been learning Unity for a few months now. So I'm new at this, but I've made great progress on my current project and I'd like to continue.
I am experimenting with a horse that I downloaded from the asset store. It can move around and collide with things just fine, and I use the mesh collider so my raycast is able to detect it (so the player can mount it, attack it, etc.). I gave it a ragdoll for when it dies, and the ragdoll animation works fine, but the mesh stays in the same standing up position nowhere near where the ragdoll is.
This would be fine if the only interaction the player has with NPCs is killing them, but when they die, you're supposed to be able to loot the body, Elder Scrolls style. Since I need the collider in order to raycast (to loot the dead NPC), I need the mesh collider to somehow follow the ragdoll.
As of now, after the horse has ragdolled, the player can point to the invisible mesh and loot the horse. If the player points to the ragdoll, they cannot loot it. I've searched on this for the past few days with some methods that looked promising, but I just can't seem to find a workaround. I read that the mesh does not recalculate because it's slow and not good for performance. If I could just somehow update the mesh after the NPC has ragdolled or find another method altogether, I would be thankful.
The image below is the ragdolled horse and its mesh.