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.
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.