My character is a prefab (model from maya export fbx) …if I put box collider into my character will lose the prefab parent.
So I have to create empty and put character into empty object.
Next add box collider in empty object.
The question is:
When character doing animation, character’s box collider don’t follow animation to change its range.
How can I let box collider follow animation to change its range?
Thanks guys!
This is confusing. I believe you are asking “How do I make a collider mimic a section of an armature?”
This isn’t really that hard. In the LateUpdate tell the box that it is the same position and rotation as whichever piece of the armature that you are working on.
So if you had a collider for a forearm, it would look like this:
var leftForeArm : Transform;
var leftForeArmCollider : Transform;
function LateUpdate(){
leftForeArmCollider.position=leftForeArm.position;
leftForeArmCollider.rotation=leftForeArm.rotation;
}
You could do some startup work to make all the colliders without having to drag them in the editor, but you get the point.
First, Thank you for your detailed explanation.
I find “Mesh Collider” is I want.
I didn’t know “Mesh Collider” before, so I use Box Collider a long time = =
Now, when I change my character animation, I also change mesh collider’s mesh.