• 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 /
  • Help Room /
This question was closed Jan 06, 2017 at 01:22 AM by JoshBaz for the following reason:

The question is answered, right answer was accepted

avatar image
Question by JoshBaz · Jun 03, 2016 at 10:39 PM · errorif-statementsenum

Enumaration error CS1025: Single-line comment or end-of-line expected

Hi. I was converting my code from Javascript to C#. The code works in JS and then I converted it to C# with no problem since I know both languages. However their are a few lines on my code where i do get error. These are the lines where I do and if statement with my enum. I don't know what the problem is since I did the enum according to how I saw it on the tutorial here. I don't know what the problem is and in Unity i keep getting the error referring to line 68:

Assets/Scripts/Car Control C#/Wheel.cs(68,0): error CS1025: Single-line comment or end-of-line expected

Please help I don't know what to do. Here's the code in question:

 enum WheelKind { Steer , SteerAndMotor , Motor , JustAWheel}; //types of wheel
 public WheelKind typeOfWheel;    //Object of WheelKind

 void FixedUpdate (){
         #if UNITY_STANDALONE || UNITY WEBPLAYER
 
         if (typeOfWheel == WheelKind.Motor || typeOfWheel == WheelKind.SteerAndMotor)
             TorqueControle ();
         if (typeOfWheel == WheelKind.Steer || typeOfWheel == WheelKind.SteerAndMotor)
             SteerControle ();
 
         #endif
         if (handBreakable){
             //HandBrake();
         }
         if(!carScript.braked){
             Decellaration();
         }
     }

Thanks in advance.

Comment
Hellium
ramonvitor

People who like this

0 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 Hellium · Jun 03, 2016 at 10:53 PM 0
Share

RTFM

https://msdn.microsoft.com/en-us/library/sbbt4032.aspx

1 Reply

  • Sort: 
avatar image
Best Answer

Answer by jgodfrey · Jun 04, 2016 at 03:36 AM

I'd guess your problem is here:

 #if UNITY_STANDALONE || UNITY WEBPLAYER

That should be:

 #if UNITY_STANDALONE || UNITY_WEBPLAYER

Notice the missing "_" in UNITY_WEBPLAYER

Comment

People who like this

0 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 JoshBaz · Jun 04, 2016 at 09:45 PM 0
Share

Oh my God thank you. I can't believe I overlooked something so simple. When I read your response I did the biggest face-palm ever! Thanks!

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

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

Related Questions

How apply something like the "!" Operator to an enum? 2 Answers

If statement not working correctly 1 Answer

how to save time and take the next variable in enum? 1 Answer

OnUnityAdsShowComplete doesn't trigger, why? 0 Answers

C# missingReferenceException when comparing enums 0 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