Having problem with Mixing Transform

Im trying to add Mixing Transform to my game and I found this example

http://www.indiegamesstudio.com/wiki/tiki-index.php?page=Unity+Animation

and I changed the script a little to meet my needs

var spine : Transform;
private var Guns : AnimationState;
private var runanim : AnimationState;
private var idleanim : AnimationState; 

function start ()
{
	Guns = animation["DrawGuns"];
	Guns.layer = 1;
	Guns.wrapMode = WrapMode.ClampForever;
	Guns.AddMixingTransform (spine);

	runanim = animation["run"]; 
	runanim.layer = 2; 
	runanim.blendMode = AnimationBlendMode.Blend; 
	runanim.enabled = false; 
	runanim.weight = 1.0f; 
	runanim.AddMixingTransform(transform);

	idleanim = animation["idle"];
	idleanim.layer = 2;
	idleanim.blendMode = AnimationBlendMode.Blend;
	idleanim.enabled = false;
	idleanim.weight = 1.0f;
	idleanim.AddMixingTransform(transform); 
}		
 function Update () 
 {
	if (Input.GetKey("w"))

	runanim.enabled = true;

	idleanim.enabled = false;

	if (Input.GetKeyDown ("k"))
               Guns.enabled = true;
}

Nothing happens :frowning: no animations play at all.

I tried doing this

function start ()
{
   shootanim = animation["DrawGuns"];
   shootanim.layer = 2;
   shootanim.blendMode = AnimationBlendMode.Blend;
   shootanim.wrapMode = WrapMode.ClampForever;
   shootanim.enabled = false;
   shootanim.weight = 1.0;
   shootanim.AddMixingTransform(spine); 
   animation ["run"].layer = 1;
   animation ["idle"].layer = 1;
   animation ["run"].weight = 0.1;
}

function Update () 
 {
	if (Input.GetKey("w"))
	animation.CrossFade ("run");
	else
	animation.CrossFade ("idle");
	if (Input.GetKeyDown ("k"))
	shootanim.enabled = true;
}

:frowning:

no one?

The minimum hours to bump is 24 hrs. Anyways have you make sure you do attach the script to a gameobject that have the component Animation and inside include the animations DrawGuns,run, idle.
Look at this.

Yes the script is attached to the game object and it has the animations. animation.play works but I cannot mix the animations. I have been googling and searched youtube but there doesnt seem to be much on this topic. Dont you see anything wrong with my scripts? are they suppose to work?

Take a look here. There’s some info on animation mixing/blending and layers.