# Precise punch animation for unity

I'm using blender to model, rig and animate my character for a Unity game, but there is something that I can't figure out by myself neither find on the internet, for example:

Lets say the main character is able to punch npcs and I want that punch aimed to the face but not all npcs have the same height.

How can the animation be adjusted to handle this?

Inverse kinematics seems to be the solution but to this date I couldn't find any good example or information about this subject better than "Check this box to fix the animation for stairs" and so on.

• If you can move your character's parts relative to each other, one way to handle this would be to put an invisible part inside your model and have your character punch that instead. When a character with a different height comes into your character's range, move that invisible part and he should still punch that instead of having the same animation. (Not sure how you'd go about it though) – John Hamilton May 4 '17 at 10:33

punchAnimator.SetLayerWeight(layerIndex, (targetpunch - lowpunch) / (highpunch - lowpunch);