• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed May 07, 2013 at 07:56 AM by Fattie for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by DVSscheme · May 07, 2013 at 04:40 AM · not workingeof

Expecting EOF found '}'

I have found the error above in unity and also "expecting ), found '}'" at line 40. EOF is at line 47. #pragma strict

 function Start () {
 
 }
 var walkAcceleration : float = 5;
 var cameraObject : GameObject;
 var maxWalkSpeed : float = 20;
 @HideInInspector
 var horizontalMovement : Vector2;
 var jumpVelocity : float = 5;
 var grounded : boolean = false;
 var maxSlope = 60;
 
 function Update () 
 {
     horizontalMovement = Vector2(rigidbody.velocity.x, rigidbody.velocity.z);
     if (horizontalMovement.magnitude > maxWalkSpeed)
     {
         horizontalMovement = horizontalMovement.normalized;
         horizontalMovement *= maxWalkSpeed;
     
     }
     rigidbody.velocity.x = horizontalMovement.x;
     rigidbody.velocity.z = horizontalMovement.y;
     
     transform.rotation = Quaternion.Euler(0, cameraObject.GetComponent(Mouselookscript).currentYRotation, 0);
     rigidbody.AddRelativeForce(Input.GetAxis("Horizontal") * walkAcceleration, 0, Input.GetAxis("Vertical") * walkAcceleration);
     
     if(Input.GetButtonDown("Jump")&& grounded)
        rigidbody.AddForce(0,jumpVelocity,0);
     
     
 }
 
 function OnCollisionStay (collision : Collision)
 {
     for (var contact : ContactPoint in collision.contacts
     
     {
     
         if(Vector3.Angle(contact.normal, Vector3.up) < maxSlope)
     
              grounded = true;
     }
 
 }
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image
1
Best Answer

Answer by robertbu · May 07, 2013 at 04:41 AM

Not sure if this is your problem or some issue with the paste, but you are missing a ')' at the end of line 36.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

13 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

StartCorutine not Working 3 Answers

Unity Jacking Up 1 Answer

Why doesnt my script work 2 Answers

how to make gunshots 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges