Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 Jul 25, 2014 at 05:40 AM by robertbu for the following reason:

Duplicate Question

avatar image
0
Question by SwagleToothWolf · Jul 25, 2014 at 05:40 AM · errorissuenoobparsing error

Parsing Error at End of Script?

 using UnityEngine;
 using System.Collections;
 
 public class FirstPersonController : MonoBehaviour {
     public float MovementSpeed = 5.0f;
     public float MouseSensitivity = 5.0f;
     public float UpDownRange = 60.0f;
     public float jumpSpeed = 20.0f;
     float verticalVelocity = 0;
 
 
     // Use this for initialization
 
     void Start () {
         Screen.lockCursor = true;
     }
     
     // Update is called once per frame
     void Update () {
         CharacterController cc = GetComponent<CharacterController> ();
         //Rotation
         float rotLeftRight = Input.GetAxis ("Mouse X") * MouseSensitivity;
         transform.Rotate (0, rotLeftRight, 0);
 
         float rotUpDown = Input.GetAxis ("Mouse Y") * MouseSensitivity;
 
         float currentUpDown = Camera.main.transform.rotation.eulerAngles.x;
 
         float desiredUpDown = currentUpDown - rotUpDown;
         //desiredUpDown = Mathf.Clamp(desiredUpDown, -UpDownRange, UpDownRange);
 
         Camera.main.transform.localRotation = Quaternion.Euler (desiredUpDown, 0, 0);
 
         //Movement
 
 
         float forwardspeed = Input.GetAxis ("Vertical") * MovementSpeed;
 
         float sidespeed = Input.GetAxis ("Horizontal") * MovementSpeed;
 
         verticalVelocity += Physics.gravity.y * Time.deltaTime;
 
         if (Input.GetButton("Jump") ) {
             verticalVelocity = jumpSpeed;
     {
 
         Vector3 speed = new Vector3 (sidespeed, verticalVelocity, forwardspeed);
                 
         speed = transform.rotation * speed;
         
         cc.Move( Speed * Time.deltaTime );     

So, I have a problem. A parsing error occurs at the end of my script, and no matter how I manipulate and changes the position of things, it is always on the last line of code. What is happening, and what is the solution?

Comment
Add comment · Show 13
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
avatar image robertbu · Jul 25, 2014 at 05:42 AM 0
Share

For future questions, search UA for your error before posting a question. This particular error is almost always a bracketing problem...usually a missing bracket at the end of the file. I see missing brackets, and a wrong bracket. Go through your code and get matching closing brackets for every open bracket.

avatar image SwagleToothWolf · Jul 25, 2014 at 06:17 AM 0
Share

could you possibly point them out..? I am a noob here and don't see them. D:

avatar image robertbu · Jul 25, 2014 at 06:42 AM 0
Share

Your Update() function has no closing bracket, your class is not closed, and I'm guessing that the bracket on line 45 is the wrong way. There may be other issues. In $$anonymous$$onodevelop, if you place your cursor on one bracket, the matching (if any) bracket is highlighted. Go through your code and figure out all the bracket pairs.

avatar image SwagleToothWolf · Jul 25, 2014 at 07:46 PM 0
Share

Ok Thank you :D

avatar image robertbu · Aug 01, 2014 at 05:47 AM 2
Share

@theorbitgames, if you are who I think you are, then you should know the reasons why we push back on questions. There are consequences to just allowing all questions on the list. The mission of Unity Answers is to provide a repository of answers so that other can search out solutions. In the past year the list has been so overwhelmed by beginner questions and so many duplicate questions that a good portion of the heavyweight contributors (the ones that help solve the difficult problems or have concrete insight into Unity) have fled regular participation on this site. This means when you really get stuck with an issue beyond beginning Unity coding, they will not be there to help you. In addition, these duplicate questions have so buried the older, informed and detailed answers, that it is beco$$anonymous$$g harder to find answers on UA.

As for this specific question, 1) it added no value to UA since it has been answer so many times, 2) it is not a Unity question since this C# script would generate the same error no matter what C# compiler or environment was used, and 3) I did OP no favors by finally giving him the debugged code. That is, the fundamental issue is that he does not understand the structure of a C# class (nor do I believe he understands the code itself). In the long run he would have been far better off fighting through the issue until he understood the structure of C# and solving it himself, rather than have me give him the solution.

Show more comments

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

I need help with this script, where are the errors? 2 Answers

Enter Trigger, display Text, then delete object 1 Answer

C# damage script help 1 Answer

Spawn Script Issue 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges