Animating "Aim" separate from "Run"

I want to have my “Aim” animation for my bow hunter to happen while he’s running. Right now I have “Aim” on layer 1, “Run” on layer 0, so Aim will override. However, “Run” disappears entirely, and I have a standing, aiming figure moving across the screen.

How can I animate only HALF of the body, from the waist up, to animate “Aim” from layer 1 while the rest of the animation (Run, Idle, Jump, Ride, etc.) still happens on layer 2 below the waist??? This way, he can aim while running, while riding a horse, while jumping, etc.

Is there some way to eliminate the below-the -waist Biped (3ds Max) from the animation? Remove the Hips, Upper legs, Lower legs, toes, etc…?? :roll: :lol:

Check out Unity - Scripting API: AnimationState.AddMixingTransform. I use it to mix a bunch of stuff, like shoot while running/walking. Works great.

Bren,

Dammit that looked perfect. Link is broken. Please advise. dammit. Maybe cut paste yer script for me if link isn’t linkin??

take the period off the end of the link

So far it isn’t working. Any ideas on where I’m going wrong? I’ve tried leaving “aim” on layer 0 and that doesn’t work either.

		animation["aim"].layer = 1;
		var spine = GameObject.Find("Male/Bip01/Bip01 Pelvis/Bip01 Spine");
		var mixTransform = spine.transform; 
		animation["aim"].AddMixingTransform(mixTransform);
		print("doing it");

:?

Doesn’t work this way, either (using transform.Find). It does print “Found the object” and “doing it” repeatedly, and there are no errors.

… head bashing time! Help!

		var mixTransform = transform.Find("Bip01/Bip01 Pelvis/Bip01 Spine");
		if(mixTransform){
		print("Found the object");
		}
		else{
		print("didn't find nada");
		}
		animation["aim"].layer = 1;
		animation["aim"].AddMixingTransform(mixTransform);
		print("doing it");
	};

In which function are you calling this code?