simple animation

i have used this script to make my animation and unity says error for “else”
here is the script if anyone can help that would be great
function Update () {

if (Input.GetAxis("Vertical") > 0.2)    
   
animation.CrossFade ("movement");   
animation.CrossFade ("movement 2");
}

else{

animation.CrossFade ("idle");}

You’re missing an opening bracket after the if(). Should be:

if (Input.GetAxis("Vertical") > 0.2)
{
  animation.CrossFade ("movement");
  animation.CrossFade ("movement 2");
}
else
{
  animation.CrossFade ("idle");
} 

p.s. These errors are much easier to spot if you indent your code blocks like this.