- Home /
Parsing error with my code
I have an error with my code, its Assets/Scripts/Player Script.cs(4,26); error CS8025; Parsing error.
my code
using UnityEngine; using System.Collections;
public class Player Script : MonoBehaviour {
public float moveSpeed = 5.0f; public int life = 100; public int maxLife = 100; public float rotateSpeed = 50; public Transform world;
// public PanningBackground back;
public int damage = 10; // Update is called once per frame void Update () {
Vector3 mVec = new Vector3(0, 0, -Input.GetAxis("Vertical"));
float rot = Input.GetAxis("Horizontal");
//print ((Vector3.up) * rot * rotateSpeed);
transform.Rotate(Vector3.up * (rot * rotateSpeed * Time.deltaTime));
transform.Translate(mVec * moveSpeed * Time.deltaTime);
mVec = transform.TransformDirection(mVec);
// bacs.currentPan += new Vector2(mVec.x,mVec.z) * Time.deltaTime;
world.Translate(mVec * moveSpeed * Time.deltaTime);
}
}
It doesn't make much sense to me why the parsing error is occurring but
Answer by uhahaha · Dec 12, 2010 at 04:10 AM
I don't see any error in your code. Just change
public float rotateSpeed = 50;
to
public float rotateSpeed = 50.0f;
and see if you still get the error.
Woophs I didn't see Justin's answer while I was answering.
Nothing.
That didn't help, it gave me another error the importer for asset Assets / Scripts / Player Script.cs ($$anonymous$$onoImporter) did not generate a $$anonymous$$D4 digest/
:(
Sounds like a different problem, I recomend starting a new question for it... And it's fine loginuhahaha =) you helped anywayssss!
Its still not working sigh. And now I get it, even if I scrap that code.
The other error I know why it happened
Answer by Justin Warner · Dec 12, 2010 at 03:55 AM
Put an f after 50 on line 4... You need to make that number a float =). Notice how you have that for line one...
Have a good night!
Your answer
Follow this Question
Related Questions
Jukebox parsing error 2 Answers
CS8025 parsing error, can't find, halp ! 0 Answers
unity 3d - c# scripting problems 1 Answer
Script Errors with C# 1 Answer
Errors CS1525 and CS8025.... 1 Answer