• 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 Davon · Dec 12, 2010 at 03:54 AM · errorparsingcs8025

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

Comment
Add comment
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

3 Replies

· Add your reply
  • Sort: 
avatar image
1

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.

Comment
Add comment · Show 4 · 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 uhahaha · Dec 12, 2010 at 04:13 AM 0
Share
avatar image Davon · Dec 12, 2010 at 05:33 AM 0
Share
avatar image Justin Warner · Dec 12, 2010 at 05:56 AM 0
Share
avatar image Davon · Dec 12, 2010 at 06:33 AM 0
Share
avatar image
0

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!

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

Answer by Davon · Dec 12, 2010 at 07:56 AM

wow fixed.

Brackets in the wrong spots...

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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

unity 3d - c# scripting problems 1 Answer

Errors CS1525 and CS8025.... 1 Answer

Script Errors with C# 1 Answer

Parsing error. No idea what it is or what the problem is. 2 Answers

CS8025 Error (Parsing Error) 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