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 /
avatar image
0
Question by Daniel G · May 28, 2013 at 10:41 PM · c#parsing errorcs8025

Unexpected Symbol 'end-of-file' C# Error CS8025

Hello, I compiled the following script and I am very new to coding in C sharp. I do not know why I am getting this error "Unexpected Symbol 'end-of-file'". I check to see if I was missing a bracket or add in the next one and I cannot seem to fix it. I know somewhat about JavaScript but I have never compiled script in C sharp.

I have included the full script.

Thank you, Dan

 using UnityEngine;
 using System.Collections;
 
 public class Touches : MonoBehaviour 
 {
     public float minDist = 2.0f;
     public float maxDist = 5.0f;
     public Transform projectile;    
     public float speed;
     private Vector3 moveVec;
     private float startZ;
     private float actualDist;
    
 void Start () 
 {        
     startZ = projectile.position.z;
 }
     
 void Update () 
 {
     //This section for move the camera position only limited values . 
     // You can Change the values for your requirements.
     //Here the camera will move with in your required portion on the screen.
 
     if(projectile.position.z >= 100)
     {            
         transform.position = transform.position + new Vector3(0.0f,0.0f,-10.0f);
     }else if(projectile.position.z <= -150)
     {
         transform.position = transform.position + new Vector3(0.0f,0.0f,10.0f);
     }
         
     if(projectile.position.y >= 140)
     {
         transform.position = transform.position + new Vector3(0.0f,-10.0f,0.0f);
     }
     else if(projectile.position.y <= -50)
     {
         transform.position = transform.position + new Vector3(0.0f,10.0f,0.0f);
     }
         
     if(projectile.position.x >= 420)
     {
         transform.position = transform.position + new Vector3(-5.0f,0.0f,0.0f);
     }
     else if(projectile.position.x <= 85)
     {
         transform.position = transform.position + new Vector3(5.0f,0.0f,0.0f);
     }
 
     // This Section For to move camera according to your swipe on screen.        
     if (Input.touchCount == 1 ) 
         {                
             Touch touch = Input.GetTouch(0);
             switch (touch.phase) 
             {
                 case TouchPhase.Began:
                 dragStartPos = touch.position;
                 moveVec = Vector2.zero;
                 break;
                 
                 case TouchPhase.Moved:
                 Vector3 pos = Camera.main.ScreenToWorldPoint(touch.position);
                 pos.z = startZ;
                 projectile.position = Camera.main.ScreenToWorldPoint(touch.position);
                 //here i gave condition to move camera with in required position 
             if(projectile.position.z >= -150 && projectile.position.z <= 100)
                 {
                     moveVec = -(touch.position - dragStartPos) * speed;
                 }
                     break;
                 
                     case TouchPhase.Ended:
                     dragStartPos = touch.position;
                     moveVec = Vector2.zero;
                     break;
             }
             projectile.Translate(moveVec * Time.deltaTime);
             Vector3 val = moveVec * Time.deltaTime;
         }
 
     //This section for pinch Zooming on screen.        
     if (Input.touchCount == 2) 
     {
         Touch touch = Input.GetTouch(0);
         Touch touch1 = Input.GetTouch(1);
         if (touch.phase == TouchPhase.Moved && touch1.phase == TouchPhase.Moved) 
         {
             Vector2 curDist = touch.position - touch1.position;
             Vector2 prevDist = (touch.position - touch.deltaPosition) - (touch1.position - touch1.deltaPosition);
             float delta = curDist.magnitude - prevDist.magnitude;
             Camera.main.transform.Translate(0,0,delta * .5f);
         }
     }
 }
Comment
Add comment · Show 2
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 Stormizin · May 28, 2013 at 10:43 PM 0
Share

Some line is showed?

avatar image Daniel G · May 29, 2013 at 12:33 AM 0
Share

Hmm what do you mean?

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by numberkruncher · May 28, 2013 at 10:44 PM

You are simply missing a curly-bracket } at the end of your script.

Comment
Add comment · Show 2 · 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
avatar image Daniel G · May 29, 2013 at 12:22 AM 0
Share

i Just tried that, this is what i got. > alt text

screen shot 2013-05-28 at 8.22.13 pm.png (276.0 kB)
avatar image Daniel G · May 29, 2013 at 12:23 AM 0
Share

I know that the var or something is missing that its referencing too but i dont know the first thing about writing C#.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

16 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 avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

HElp fix this Assets/enemy/2.cs(1,12): error CS8025: Parsing error 0 Answers

Learning C# instead of doing what tutorials say... 2 Answers

What parsing errors do i have 1 Answer

Attach object as child using code 1 Answer


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