Collision shape following bones

Godot Version

4.2

Question

Hello, I have Rigidbody3D with an animated Skeleton inside to have the animation. For now the collision is a simple capsule but I want to make it more complex, I was hoping to get a system like CSGO where I can attach collision to bones. I tried but either using BoneAttachement or a custom script setting the CollisionShape position to the bone position but neither are working. How can I do that ? Thanks!

You can create a physical skeleton to add collision for bones. You can check here how to do it:

I don’t think this is working. Those physical bone collision are not following the bones when they are animated. And they also don’t report as collision of the parent rigidbody.

Yeah, I forgot how physical bones actually work, sorry. You have to activate them using physical_bones_start_simulation() but it’ll make them go ragdoll, so probably not what you want…

I was working through something similar trying to add a hit box the the end of a hammer. The mesh instance was connected to the bone and from there I could add an area 3d (named hitbox) and collision shape 3d of it, each the child of the last. This got a hit box staying in a fixed relative position to the bone (shape stuck to the end of the hammer).

What you could do is add hit boxes to each bone and customise thier shapes with collision shape 3d giving you a more accurate hit box for the model. I understand my solution only worked because the hammer is a sperate mesh instance to the body. To remedy this, and I hope you used a test model, remake your models body as spereate meshes in blender all parented to the correct bone on the original skeleton (allowing you to keep animations) so when its ported into godot each body part has a distinct mesh instance allowing for them all to have thier own hitboxes attached. This will drag down prossessing power but if you have a better way since march please tell me.

Hello, did you find a solution? Because I’m facing the same issue now and can’t find any info how to do it.