- Home /
Attach collider to bone, how to?
Can someone explain to me how to do this so that my collider can move with my axe? The axe is linked to my chars hand, so I thought that the hand bone would do it, but I don't know how to attach them.
Thanks
Answer by Owen-Reynolds · Nov 15, 2011 at 03:29 PM
By "linked to char's hand" do you mean the axe has a bone? Or do you man the axe is a separate object with the hand as a parent? Or is there a hand-bone and the axe is more verts in the envelope of the hand bone? I'm going to assume the axe is part of the mesh (which is an uncommon solution -- can't switch weapons.)
Select the bone, in your case, the bone for the axe, or hand. You'll see it counts as a Transform. Click "Component" on top, select the collider you want and shape it however.
If the mesh belonging to the bone is some odd angle (like the hand bone goes one way, but the axe verts run diagonal off of it) you'll need one more trick. You can slide colliders, but can't rotate them. In that case, make an empty child of that bone (maybe call it "axe collider",) and attach the collider to that. You can rotate the collider by rotating that empty.
I got in here when searching for parenting for colliders on Compound Colliders, so just In case you run into my same problem and got here looking for the same solution...
When you try to work with compound colliders and try this metod (atttaching the collider to an empty game object and using them as triggers) you'll find that if you use that collider as a trigger later, what you do with it only affects the Empty game object containing it. If you want to affect the actual parent, however deep is your hierarchy, try using "transform.root.gameObject" This way, when using a trigger that is nested deep into the hierarchy of the object, you can still refer to the whole game object.
I know this answer doesn't belong here, and I'm sorry, but I could not find this answer anywhere else and just in case somebody else gets in here looking for that, he might get some insight :)
Answer by AbirBK · Apr 17, 2014 at 05:10 PM
you might try attaching the capsule collider to a bone in your mesh ! please how can i do that :( ?
Your answer
Follow this Question
Related Questions
attaching armor to bone in proper position !!! help! 2 Answers
Attaching an object to a bone? 3 Answers
Attaching an object to bone dynamically 0 Answers
Internal collisions 1 Answer
Attach a cloth to a character 0 Answers