Collision Based Melee Combat

Ok, so I know how to make a basic game with melee combat using a targeting system, but now I want to know how to make a combat system based on collisions. A targeting system seems easier but you can only hit to opponent you’re targeting. I want to make a system where anything your weapon hits will be damaged. I’ve already got a basic idea, but for some reason it won’t work. I’ve set up a basic scene with a box and a humanoid character. On the armatures of the character’s hands I added box colliders and made them triggers. I then made a script using the OnTriggerEnter function to Debug when the object was hit, but it doesnt register the hit. Does anyone know why?

I have had simular problems when moving collisionboxes around.
I ‘think’ it has to do with the fact that the collision is moved with script and animation, and not trough physx?
So it could be so simple as the box not being awake beause in it’s physical world it hasn’t actually moved?

Never got around to poke around with this more, so if anyone have anymore input around this I am cursious as well.

I also thought that may be the problem. If it is it may be possible to use distance or I think I heard something about a Raycast sphere. One of those might work instead.

You have to have a rigidbody on either the thing your hitting or the weapon itself.

Thanks a lot. That was giving me quite a few problems.

your doing it wrong what you need is OnCollisionEnter then you use add force OnTriggerEnter makes the collier olny respond to commands in script or you can give a physics material to the object unity comes with a couple like rubber and ice i made a playable character who bounce whenever he collided with anything without scripting