Animate a "punch" to adjust with aim?

Does anyone have any good ideas on how to do this…

In a 3rd person boxing game, I want to animate the boxer to punch. But I want the punch to always aim towards the direction of the crosshairs. For example, when the crosshairs aim at an enemies stomach, the player will throw a punch toward the enemies gut.

How would you make the character’s “punch” adjust to hit a specific target?

Similarly, in baseball games like this (click), the batter is animated to swing at the pitch. The batter is doing the same action, swinging the bat, but the swing adjusts slightly to aim at the crosshairs.

Any ideas?

Could(should) be done with IK but unfortunately we dont have that in BGE(last I heard)

You could use python to calculate the position of the target, and this position you can adjust it to animate the character:

Let’s say:
Cursor is at the top, the torso animation is on 0 (the torso is curved so the character seems to be aiming to the top)
Cursor is around the middle, torso animation is on 50 (this spot would be the normal stance of the character qith the bat)
Cursor at the botton, the torso animation on 100 (this postion make the character seem to be aiming to the botom)

The torso animation must be blended with the “hit” animation, so this hit animation gets distorted by the “torso” animation.

Hope this is understandable.

So, ipo the torso to bend up/down with the mouse, then punch normally. That might work. I’d probably have to use trial and error to get it exactly right.

put a plain over each part of the other character say head. and add sensor “cursor over” and what ever you use for the puch button attach them both to an “and” controller then select both the plain and the armature. then connect it to an actulator on the armatures as an action like Punch_head