Animator set current animation normalized time.

Hey Guys,

I have asked this question in the past, but I did’nt get any answer. I don’t know if it is because it is not possible to do what I want to do but I would really appreciate if some one could help me on that one. The problem is that i have characters that I spawn at the same time and they are beside each other. The all bread at the same time and I wonder if there is some way to tell the animator to set its normalized time to a random value in the current animation (on multiple layer, because their clothing is animated in another layer) so they could breed in an independant way from each other. Does anybody have an idea ?

Thanks for your generous time.

Claude

Hey guys,

Found the answer ! It might help some one. So the idea is to use this Play method on the animator and you can set the normalized time as last parameter and you can tell which layer to play your animation. Here is an example of what I did. Don’t forget with your random to explicitly write 0f and 1f because if you go 0,1, it will always be 0 because it is considered as an int number.

Thanks a lot and have a great day

//Breed at at random pace
float random = Random.Range(0f,1f);
mController.Play("Idle",0,random);
mController.Play("Blend_Idle",1,random);