Hi everybody, I’m trying to have differents idle in the same character, but I’m having problems with the yield WaitForSeconds, or most probably my programing logic is not good enought. The Debug value start to going crazy alter inicialization. This is what I been doing. I also try to skip the update function, but with no luck. I Also try diferents approach to the same problem but with no luck either. Any help will be welcome.
Thanks in advance. 
private var idleA = false;
function Start ()
{
animation.Play ("idle");
IdleA ();
}
function Update (){
IdleA ();
Debug.Log (idleA);
}
function IdleA (){
if (idleA){
animation.CrossFade ("idle2",0.1);
yield WaitForSeconds (1);
idleA = false;}
if (!idleA){
animation.Play ("idle");
yield WaitForSeconds (4);
idleA = true;}
}
How about creating 2 arrays. The first are idle names the second are weights. then just add up the total weights, multiply that times a Random.value. go though the weights one by one, subtract the weight value and if it is zero or less, that is the idle you have choosen.
This is hack code. I honestly have never messed with the animations but that isn’t your primary question… 
var idleNames : String[];
var idleWeights : int[];
function Update(){
if (animation.isPlaying)return;
var totalWeights=0;
for(weight in idleWeights){
totalWeights += weight;
}
var weight=Mathf.Floor(Random.value * totalWeights);
for(var i=0; i<idleWeights.length; i++){
weight-=idleWeights[i];
if(weight<=0){
animation.CrossFade (idleNames[i],0.1);
i=idleWeights.length;
}
}
}
Thank you very much, after some tests with your code, it seems to do the trick! I added a timer to have enough time to play the animations. Here is the modified code 
var idleNames : String[];
var idleWeights : int[];
//var random = 1;
private var stopRandom = false;
private var random : int = 1;
function Update(){
//if (animation.isPlaying)return;
var totalWeights=0;
for(weight in idleWeights){
totalWeights += weight;
}
if (!stopRandom){
TimerIdle ();}
var weight=Mathf.Floor(random * totalWeights);
for(var i=0; i<idleWeights.length; i++){
weight-=idleWeights[i];
if(weight<=0){
animation.CrossFade (idleNames[i],0.8);
i=idleWeights.length;
}
}
Debug.Log(random);
}
function TimerIdle (){
if (!stopRandom)
random = Random.Range(-3, 3);
stopRandom = true;
yield WaitForSeconds (1.1);
stopRandom = false;
}
Thanks again for the quick help 