Any good way to handle physical melee weapons?

Hi all. I’m trying to build a 3rd person action game but I’m having a hard time figuring out how to handle weapon swinging. I want the weapons to behave like physical objects and for your “arm” to have a limit on the amount of force it can exert. I’ve been messing around for a while with physics constraints, but they’re proving to be a nightmare. I also tried making a swing by just interpolating between two transforms, but then it can push with infinite force and the collision and stuff seems to be a bit weird.

I haven’t attempted any animation-driven method yet. Is it possible to animate an arm and attach a physical object to the end of it? Or is there some normal way to do this that I’m missing? It seems like it should be a pretty common feature . . .

Thanks

Animation-driven methods work out pretty well. Your animations can have notify events, which I use to enable or disable collision on a capsule on the sword in the character’s hand. Yes, you can attach an object to a skeletal mesh in this fashion. You would use a socket placed somewhere on the skeleton that would act as the attachment point. In this case, the socket is on the hand of the skeleton, and attaching a sword to it allows for the sword to swing with the arm during animation. During the actual swing, the collision is activated to allow for hitting things, and at another point in the animation it is disabled so we don’t hurt ourselves or allow the sword to harm things without being swung.

OK, gotcha. Yeah I’ve used sockets a bit. My concern with the animation method is how to control the force of the swing. It should be able to push some things around, but not heavy or static objects. It sounds like you might have that figured out though, I guess I should do my research on this . . . :slight_smile:

Currently I’m trying pushing the hand (and whatever it’s holding) along a spline path, which I thought was a great idea at first, though it seems like splines are rather a pain to work with.

I guess people generally don’t care about using physics for this stuff. Which is understandable considering the trouble I’ve had with it, heh.