- Home /
 
 
               Question by 
               Fexception · Apr 28, 2014 at 02:54 AM · 
                javascripterrormonodevelop  
              
 
              Script copied exactly, yet I get the console errors
I am doing this tutorial on making a sphere on a long rectangle jump by pressing the W key, and I can roll the ball using A or D. This is the 2nd time I've followed one of this guys tutorials which produce console errors for me and not for him. Here is a screenshot of his code on youtube:

And here is my code, followed by the Unity console error:
 #pragma strict
 
 var rotationSpeed = 100;
 var jumpHeight = 8;
 
 private var isFalling = false;
 
 function Update ()
 (
     //handle ball rotation
     var rotation : float = Input.GetAxis ("Horizontal") * rotationSpeed;
     rotation *= Time.deltaTime;
     rigidbody.AddRelativeTorque (Vector3.back * rotation);
     
     if (Input.GetKeyDown(KeyCode.W))
     (
         rigidbody.velocity.y = jumpHeight;
     )
 )
 
               And error: 
What gives???
 
                 
                capture.png 
                (236.3 kB) 
               
 
                
                 
                capture2.png 
                (22.9 kB) 
               
 
              
               Comment
              
 
               
               
               Best Answer 
              
 
              Answer by getyour411 · Apr 28, 2014 at 02:54 AM
Functions are opened and closed with squigglies { } instead of parens ( ), same with if blocks
Your answer
 
             Follow this Question
Related Questions
A node in a childnode? 1 Answer
Cant Add Script (or create any new scripts) Javascript 2 Answers
Strange movement behavior 1 Answer
Scripting Error Help Needed 2 Answers
Error BCE0044 JavaScript 1 Answer