I need my character to be able to have the option of attacking while running or while standing still. I am having a hard time thinking of how to go about this. When I play games like call of duty the characters seem to be carrying out 2 animations at once, one for the the lower body and one for the upper. How do I go about implementing a system like this? Or is there a better way to do this?
What may be the most ‘correct’ way is to build your animations ‘properly’.
If a bone has NO animation data for an animation, that animation will have NO effect on that bone - meaning, if you have a LegsRunForward animation which only affects the leg bones, you can play that at the same time as your AimGunBackward animation (which only affects the rest of the bones), and they won’t interfere with each other.
Blender (2.5 and earlier, at least) does not export animation properly for that particular solution. If it’s 2.49 or earlier, you can change the fbx_export.py file to only export animated bones, but the default behaviour is to animate every bone, making the animations incompatible.
Another way which is simpler and probably works in many situations:
Animation happens between Update and LateUpdate. Rotate the character’s upper body in LateUpdate to override whatever animation is playing, and you can get away with perhaps just forward/backward movement animations.