Error CS8025: Parsing Error
Im getting an error that says: Assets/Scripts/Player.cs(29,9): error CS8025: Parsing error and i dotn know whats causing it so please help me. My code:
using UnityEngine; using System.Collections;
public class Player : MonoBehaviour {
public float velociadade ;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
Movimentar();
}
void Movimentar()
{
if (Input.GetAxisRaw ("Horizontal") > 0) {
transform.Translate (Vector2.right * velociadade * Time.deltaTime);
}
if (Input.GetAxisRaw ("Horizontal") < 0) {
transform.Translate (-Vector2.right * velociadade * Time.deltaTime);
}
i have the same error in this sentences please i need to know what's the probleme here .this is where's the probleme appear : **void carry (GameObject o){ o.rigidbody.iskinematic=true ; o.transform.position=mainCamera.transform.postion+mainCamera.transform.forward*distance ; }
Answer by sargunster · May 30, 2014 at 10:21 PM
You're missing a closing curly brace '}' at the end of the file.
EDIT: And another one at that last 'if' statement.
Answer by Andorid42 · May 08, 2016 at 12:37 AM
In running through the tutorial I noticed after a crash that if you copy and paste in code and there are more command line numbers you will get this error even if the brackets around functions are correct. try deleting excess lines from script, until just before the terminating bracket it will go away.
Answer by Pistol_Bear · Aug 02, 2016 at 02:00 PM
Hi, I had a similar problem and I was able to fix it in the following manner:
First I checked my curly braces as many of these users have needed to do, but my code was fine. Further more, I knew my code was fine because it had worked before, but my Library folder had been nuked so I had to copy-paste a bit.
So another thing to check here is the fact that VS and Mono don't play the same game with regards to line endings. MonoDevelop uses the same one all the time and VS does whatever it feels like at the time. So for each file that I was getting the CS8025 error, I opened it in VS and went to File->Advanced Save Options and changed "Line endings" to be Windows (CR LF). I'm on windows 10, ymmv.
@RadamSTGamer - if you haven't picked an answer yet for this question, consider picking one, as this issue seems to to need it.