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?
1 Answer
1What 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.
Dunno, haven't used it. I have my fbx exporter set up the way I need it and I don't really want to putz around with whatever the new version is - I couldn't even find the py file in 2.5. :(
– LoiusI use Blender 2.63 and didn't set any export options. I just used Mixing Transform http://docs.unity3d.com/Documentation/ScriptReference/AnimationState.AddMixingTransform.html and Animation-layers http://docs.unity3d.com/Documentation/Manual/AnimationLayers.html.
– ExTheSeaThose are impressive. One question on that - AddMixingTransform has terrible documentation. Does calling it once suddenly make the animation only affect the one transform/tree you've sent in? And then you send in a bunch more, or whatever, so you essentially just tell it the entire set of transforms you want animated?
– LoiusWould it work if I just make all the animations one after another in blender and then split the animations in unity?
– filler03
filler i saw in my email-account that you posted a comment which doesn't show up here for me. You should make every animation a seperate action. Under the dope editor you can select the action editor. this way you can add new animation. Important mark them with the F otherwise they won't get saved. If you need more information there are several tutorials on youtube.
– ExTheSea