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 Nov 03, 2015 at 09:01 PM by Dave-Carlile for the following reason:

The question is answered, right answer was accepted

avatar image
2
Question by mido555 · Jan 29, 2011 at 02:18 PM · errorparsingcs8025

CS8025 Parsing error

Im getting an error that says: Assets/Scripts/EnemyAI.cs(35,9): error CS8025: Parsing error and i dotn know whats causing it so please help me :)

here is my code: using UnityEngine; using System.Collections;

public class EnemyAI : MonoBehaviour { public Transform target; public int moveSpeed; public int rotationSpeed; public int maxDistance;

private Transform myTransform;

void Awake() { myTransform = transform;

}

// Use this for initialization void Start () { GameObject go = GameObject.FindGameObjectWithTag("Player");

 target = go.transform;

 maxDistance = 2;

}

// Update is called once per frame void Update () { Debug.DrawLine(target.position, myTransform.position, Color.yellow);

 //Look at target
 myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed * Time.deltaTime);

 if(Vector3.Distance(target.position, myTransform.position) > maxDistance) {
     //move towards target
     myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;
 }

}

Comment
Comments Locked · Show 1
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 mido555 · Jan 29, 2011 at 02:23 PM 0
Share

Sorry this is wrong turns out it was a unity error i restarted unity and now it works fine :)

3 Replies

  • Sort: 
avatar image
3
Best Answer

Answer by Statement · Jan 29, 2011 at 02:25 PM

public class EnemyAI : MonoBehaviour { // ...

 void Awake() 
 {
     // ...
 }

 void Start () 
 {
     // ...
 }

 void Update () 
 {
     // ...
 }

} // <- You are missing one of these.

Reformatting the code so it's easier to read shows that you are missing a curly bracket to close the class.

Comment
Add comment · Show 1 · 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 mido555 · Jan 30, 2011 at 11:10 AM 0
Share

thanks i already found that out after looking there and saying to my self "hmm should i put curly brackets there?" for 5 $$anonymous$$s but thanks anyway :)

avatar image
0

Answer by koby2010 · Mar 10, 2013 at 05:26 AM

I need help My program wont work! This is it

using UnityEngine;

using System.Collections;

public class shooter : MonoBehaviour {

public Rigidbody bullet;

public float power = 1500f;

public float moveSpeed = 2f;

void Update () {

     float h = Input.GetAxis("Horizontal") * Time.deltaTime * moveSpeed;
 
     
     float v = Input.GetAxis("Vertical") * Time.deltaTime * moveSpeed;
     
     
     transform.Translate(h, v, 0);
     
     if(Input.GetButtonUp("Fire1")){
     
         Rigidbody instance = Instantiate(bullet, transform.Position, transform.Rotation) as Rigidbody;
 
         
         Vector3 fwd = transform.TransformDirection(Vector3.forward);
         
         
         instance.AddForce(fwd * power);
 }

}

Comment
Add comment · Show 3 · 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 jessefig12 · Dec 10, 2014 at 01:53 AM 0
Share

well this isent an anser but i had the same problem with the error and i dont feel like restarting it and doing the code all over again what does pasing $$anonymous$$EAN!!!!!!!!!!!!!!!!!!

avatar image jessefig12 · Dec 10, 2014 at 01:54 AM 0
Share

sorry parsing error mean

avatar image hoy_smallfry · Jan 09, 2015 at 10:01 PM 0
Share

There are more than enough answers on UA about CS8025. Please don't make yet another question for it. In fact this question should be closed for being a duplicate. I would, but I don't have the priveliges.

avatar image
0

Answer by mcgrewjosh98 · Nov 03, 2015 at 08:59 PM

This is the Error that I am getting: Assets/Plugins/GameManager.cs(127,4): error CS8025: Parsing error

I have no idea what is wrong and I don't have any kind of knowledge in JS or C#.


using UnityEngine; using System.Collections; using System.Collections.Generic;

public class GameManager : Photon.MonoBehaviour {

 public GUISkin skin;
 public Transform playerPrefab;

 public static Transform localPlayer;
 public static List<Transform> players = new List<Transform>();

 public static Transform GetClosestPlayer(Vector3 fromPos)
 {

     Transform close = null;
     float dist = -1;
     foreach (Transform tra in players)
     {
         if (tra == null)
         {
             continue;
         }
         float thisD = Vector3.Distance(tra.position, fromPos);
         if (dist == -1 || thisD < dist)
         {
             dist = thisD;
             close = tra;
         }
     }
     return close;
 }


 public static void AddPlayer(Transform tra)
 {
     players.Add(tra);
 }
 public static void RemovePlayer(Transform tra)
 {
     players.Remove(tra);
 }

 void Awake()
 {
     if (Application.loadedLevel < 1)
     {
         Debug.LogError("Configuration error: You have not yet added any scenes to your buildsettings. The current scene should be preceded by the mainmenu scene. Please see the README file for instructions on setting up the buildsettings.");
         return;
     }
     //PhotonNetwork.sendRateOnSerialize = 10;
     //PhotonNetwork.logLevel = NetworkLogLevel.Full;

     //Connect to the main photon server. This is the only IP and port we ever need to set(!)
     if (!PhotonNetwork.connected || PhotonNetwork.room == null)
     {
         Application.LoadLevel(0);
         return;
     }

     PhotonNetwork.isMessageQueueRunning = true;
     //Spawn our local player
     GameObject GO = PhotonNetwork.Instantiate(playerPrefab.name, transform.position, Quaternion.identity, 0);
     localPlayer = GO.transform;

 }

 void OnGUI()
 {
     GUI.skin = skin;
     GameGUI();
 }

 bool showDebug = false;

 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Q))
         showDebug = !showDebug;

     if (Input.GetKeyDown(KeyCode.Escape))
     {
         Application.Quit();
     }
 }

 /// <summary>
 /// Check if the game is allowed to click here (for starting FIRE etc.)
 /// </summary>
 /// <returns></returns>
 public static bool GameCanClickHere()
 {

     List<Rect> rects = new List<Rect>();
     rects.Add(new Rect(0, 0, 110, 55));//Topleft Button
     rects.Add(new Rect(0, Screen.height - 35, 275, 35));//Chat

     Vector2 pos = new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y);
     foreach (Rect re in rects)
     {
         if (re.Contains(pos))
             return false;
     }
     return true;

 }

 void GameGUI()
 {
     GUILayout.Space(32);
     if (GUILayout.Button("Leave"))
     {
         PhotonNetwork.LeaveRoom();
         Application.LoadLevel(Application.loadedLevel + 1);
     }

     if (showDebug)
     {
         GUILayout.Label("isMasterClient: " + PhotonNetwork.isMasterClient);
         GUILayout.Label("Players: " + PhotonNetwork.playerList.Count);
         GUILayout.Label("Ping: " + PhotonNetwork.GetPing()
     )
 ;

}

Comment
Add comment · Show 1 · 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

Follow this Question

Answers Answers and Comments

8 People are following this question.

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

Related Questions

Errors CS1525 and CS8025.... 1 Answer

Script Errors with C# 1 Answer

CS8025 Error (Parsing Error) 1 Answer

Parsing error with my code 3 Answers

Parsing error. No idea what it is or what the problem is. 2 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