mixing rigged walking with imported animation.

I have a fully rigged character I bought from 3DRT.com fbx format with lots of animation I would like to use (2,500 frames 50+ clips), but it is sort of skating over surfaces instead of walking properly in parts of the animations.

I would like to keep the upper body movement and script the legs and feet.I know I can find out how to script legs from the birds in the Island demo. I am wondering is it possible/reasonable to try and combine (blend?) scripting the legs and imported animation? If it is I don’t mind spending hours tweeking the script and blend settings( :smile: should be fun), I mainly wondering if this is the right way to approach the problem.

here is an example if your curious
http://www.ryuuguu.com/unity/tttdz.html

Cheers,
Grant

The webplayer isn’t working for me. Did you accidently build it with a beta version of Unity?

Yeah I probably did.
[edit]

Ok uploaded with 2.0 should be ok now.

Cheers,
Grant

Try this script:
function Start ()
{
// Add a duplicate shoot animation which we set up to only animate the upper body
// We use this animation when the character is running.
// By using mixing for this we dont need to make a seperate running-shoot animation
animation.AddClip(animation[“shoot”].clip, “shootUpperBody”);
animation[“shootUpperBody”].AddMixingTransform(transform.Find(“gun”));
animation[“shootUpperBody”].AddMixingTransform(transform.Find(“roothandle/spine1”));

// Set all animations to loop
animation.wrapMode = WrapMode.Loop;

// Except our action animations, Dont loop those
animation[“jump”].wrapMode = WrapMode.Clamp;
animation[“shoot”].wrapMode = WrapMode.Clamp;
animation[“shootUpperBody”].wrapMode = WrapMode.Clamp;

// Put idle and run in a lower layer. They will only animate if our action animations are not playing
animation[“idle”].layer = -1;
animation[“run”].layer = -1;

animation.Stop();
}

function Update () {
// Play either the run or idle animation
if (Mathf.Abs(Input.GetAxis(“Vertical”)) > 0.1)
{
animation.CrossFade(“run”);
// Play animation backwards when running backwards
animation[“run”].speed = Mathf.Sign(Input.GetAxis(“Vertical”));
}
else
animation.CrossFade(“idle”);

// Play the cross fade animation
if (Input.GetButtonDown (“Jump”))
{
animation.CrossFade(“jump”, 0.3);
}

// Play the shoot animation
if (Input.GetButtonDown (“Fire1”))
{
// We are running so play it only on the upper body
if (animation[“run”].weight > 0.5)
animation.CrossFadeQueued(“shootUpperBody”, 0.3, QueueMode.PlayNow);
// We are in idle so play it on the fully body
else
animation.CrossFadeQueued(“shoot”, 0.3, QueueMode.PlayNow);
}
}
It’s for the Soldier in the character animation project. If you run and turn left
or right, the character leans in the correct direction.

AweSome I’ll try combining that with the Heron walking script from Island demo.

Thanks,
Grant