animation doesn't play smoothly

hi, so i have this windmill with one animation and i have this javascript.
function Update () {

animation.Play(“millan”);

}
the problem i’m having is that the fan spin and stop and it spin and stop. can anyone advice on this?

You are basically starting the animation over and over again, even if it’s already playing. That’s like trying to start a car while driving at 120 km/h. :wink:

Make a check whether the animation is already playing and start it only if not.

However note that you are using the legacy animation system which is basically meant to be replaced by Mecanim.

i got it working now. I didn’t know mecanim support anything else beside character