   Mouse-controlled Melee
  I'm working on a gladiator combat game and I need to implement a system where the sword follows the mouse, ala Die By The Sword. How would I go about implementing this?Thanks,Smeagol   
  I've never played Die by the Sword so I don't know exactly how the mechanic works, but I'm assumming it has the characters arm point in the direction of the mouse, perhaps it works based off relative mouse motion. If I were making a game based off a sword following a mouse cursor position then this is how I would do it.I would assume where the player is located that the mouse's position is located on a plane parallel to the players x axis about 10 meters in front of him. Then I would create a ray from the mouse position projected on that plane to the player to get the direction the sword should be facing. Though, getting the target orientation is the easy part! This gets a lot more complicated quicker, depending on the quality of the animation you are looking for.First, since the arm and sword is going to be entirely procedural your going to want to mask those bones off from the rest of the characters animation. Then what you want is a swing left animation, swing forward animation, swing down animation, swing right animation, and swing up animation. These animations should all start from the center, then you can transition to the center animation, and blend to the target animation and use Inverse Kinematics to position the sword in its target position. That will get you a working implementation but full swings from opposite corners are going to give you unnatural movement, for those cases you'll probaly want seperate animations.- Dave   