- Home /
 
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");} 
 
 
              
               Comment
              
 
               
               
               Best Answer 
              
 
              Answer by tanoshimi · Nov 10, 2013 at 08:42 AM
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.
No problem ;) Please help keep the board tidy and mark this as the answer if it solves your problem.
Your answer
 
             Follow this Question
Related Questions
issues with animation :( 1 Answer
Animation Script Error 1 Answer
Unity does not recognize reload animation for gun 1 Answer
(C#) Problem with animations not playing 1 Answer
UCE0001: ';' expected. Insert a semicolon at the end 1 Answer