Play two animations at the same time

I have seen this done many times with other peoples blender games. A good example of this is the game medievil :evilgrin:.
You can run around and swing the top half of your body to strike something while the bottom half of your body continues to run. i’ve tried this several times but either the run animation will override the sword swing animation or the sword swing animation will override the run animation. how can this be achieved?:confused:

the torso needs a separate armature, this way the torso animation can be different then the legs,

This is possible with Blender’s layered animation system. You are able to play two animations at the same time on two different layers. The layer with the greater priority plays over the layers with less.

For example, you could have a “running” animation on layer 1 that moves both the arms and feet. On layer 2, you could have the “arm swinging a sword”. You could play layer 2 over layer 1, and if the priority on layer 2 is greater than the priority on layer 1, then the “arm swinging a sword” animation plays over the arms in the “running” animation. Overall, it’ll look like your player is swinging its sword while running.

I made a quick example, while the it may look there are two separate objects, it’s actually just one object with one armature. When you press space, an animation layer, with a higher priority, is added on top of the current layer playing. Both of the objects rotating is one action (pretend this is the “running” animation). When the bar on the right moves up an down by pressing space, this is a separate action (pretend this is the “arms swinging a sword” animation).

I’m writing this pretty late, but I hope this makes sense.
animation_ex.blend (458 KB)

yeah , use different layers
i found it bit hard to manage,but is just my limitation(and for my style of game RTS not need),
really it work perfectly, moguri done a amazing job!

Thank you so much Linkxgl!!! I feel stupid knowing how easy this to do:spin: