Box collider on attack

I am trying to make a melee system with colliders. However one of my problems is that the box collider won’t follow the mesh. Now I have tried somethings.

The mesh and animations are from blender by the way.

I have attached the collider to the bone of the weapon since animations without armatures do not seem to work when imported into unity. If I am wrong and over looking something please let me know. So anyway attaching it to the bone works except I cannot play the animations through the script attached to the bone. The script seems to need to be on the actual object with the animations, aka the weapon, in order to use them.

Also I tried two separate scripts on for playing the animations(attached to the weapon) and one for the hitting and damage dealing(attached to the bone) but that does not work either since I need to know if the animations are playing in order to know if I need to take away damage. IsPlaying() does not pick up on animations playing in other scripts.

It does work if I attach the same script to both the bone and the weapon but I don t like activating the same script twice on basically the same object and its a bit buggy.

Even weirder, I uncheck the script off either object in the inspector and it still works but if I remove the script as a component off either object, it breaks. I thought unchecking was a way of testing if you could remove something but apparently its different and I don’t understand why.

Summary:
How do I get a simple collider to stay on an object while that object is being animated without using the bone?
Or how can I access the animations in the parent of an object essentially, access the animations of the weapon from the bone of the weapon?
Note: having animations in the script and simply saying play does not work when the script is attached to the bone.

If this is confusing I ll try to clarify. I know that I often am bad at explaining things especially if I try to go in detail.

You were on the right track by putting the collider on the bone of the weapon.

Your weapon script will be on the weapon bone. But this script needs a way to know when the animation is playing. The easiest way is to create a public property that references the Animation component on the main object.

Here’s some C#, but UnityScript would be similar:

    // Drag the main object's Animation component onto this in the Inspector:
    public Animation mainAnimation;

    void Awake() {
        // Just in case you forgot to assign it manually:
        if (mainAnimation == null) {
            mainAnimation = transform.root.GetComponent<Animation>();
        }
    }

    void OnCollisionEnter(Collision info) {
        if ((mainAnimation != null) && (mainAnimation.isPlaying)) {
            // Deal out some damage!
        }
    }