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 /
avatar image
0
Question by vivtoons · May 26, 2013 at 08:19 PM · syntaxhighlighting

Syntax is not highlighted. Plz help.I am new to unity

![![alt text][1]][1]

Hi I am new to Unity.The problem I am facing that in MonoDevelop the predefined functions and classes are not highlighted.So,I am unable to see if I have written it correctly or not.Can you suggest what should I do??

nothightlighted.jpg (235.3 kB)
nothightlighted.jpg (235.3 kB)
Comment
Add comment · 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 robertbu · May 26, 2013 at 10:11 PM 1
Share

Your onCollisionEnter() would never be highlighted since at syntax checking time, there is no way for the checker to know if you are trying to use an override or declaring your own function.

But I find the lack of auto-complete to be more of a problem with Javascript than with C#. If you have any error above your current position, the checker seems to be confused and give up (i.e. not show autocomplete entries). If I'm not getting a autocomplete list, I switch back to Unity and fix any errors above the current position. The C# checker seems to be smarter in that it seems to be able to recover from errors better.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by numberkruncher · May 26, 2013 at 08:30 PM

What you are seeing is the intended behaviour of MonoDevelop since the identifiers which you have highlighted in the screenshot are just regular methods and properties like any other.

Syntax errors are usually underlined in red wiggly lines within MonoDevelop, though rest assured, actual errors will be logged in the console window :)

Comment
Add comment · Show 5 · 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 vivtoons · May 26, 2013 at 10:05 PM 0
Share

But it should give me auto complete atleast..How would I know while coding that I am going right or wrong?

avatar image numberkruncher · May 26, 2013 at 10:27 PM 0
Share

If you want better auto-complete with $$anonymous$$onoDevelop then you would probably be better off using C#. On a side note, the syntax is very similar to UnityScript, and if you are just starting out then C# might be a better starting point anyway.

You should probably get used to using the Unity documentation since it documents each function and class. And of course, the console window will reveal when you have errors and you can use that in conjunction with the API documentation.

I agree with @robertbu, it would be nicer if UnityScript had autocomplete. Perhaps you should consider using C# ins$$anonymous$$d if you rely upon autocomplete...

avatar image vivtoons · May 27, 2013 at 12:25 AM 0
Share

Actually, the thing is I heard javascript is easy for beginners.Is there any other editor which can give me autocomplete and highlights the methods.Like here onCollisionEnter is not a method created by me but still it is not showing it in color.

avatar image numberkruncher · May 27, 2013 at 12:54 AM 0
Share

$$anonymous$$onoDevelop does not distinguish between functions that are exposed by the Unity API, the $$anonymous$$ono API nor your custom functions.

UnityScript is similar to regular JavaScript, though it seems far more comparable with ActionScript. In general there is more documentation for C# since it is a very widely used language whereas UnityScript is unique to Unity.

Here is an example of what I mean regarding the differences between UnityScript and C#:

 // UnityScript (aka JavaScript)
 import System.Collections.Generic;

 public var someString:String;
 public var someListOfStrings:List.<String>;

 function Awake() {
     someString = "Hello World!";
     someListOfStrings = new List.<String>();
 }

 // C#
 using UnityEngine;
 using System.Collections.Generic;

 class YourScriptName : $$anonymous$$onoBehaviour {

     public string someString;
     public List<string> someListOfStrings;

     void Awake() {
         someString = "Hello World!";
         someListOfStrings = new List<string>();
     }

 }

Anyhow, I hope that you find a solution which you find comfortable with. If you prefer the UnityScript syntax then fantastic! If you are entirely new to program$$anonymous$$g then you may find it easier to get started with C# ins$$anonymous$$d. Just my opinion :)

avatar image vivtoons · May 27, 2013 at 01:04 AM 0
Share

Thankyou.I am trying javascript since I can find many tutorials of it.Let's see how it goes.

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.

Follow this Question

Answers Answers and Comments

16 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

Related Questions

MonoDevelop 5.9 adding syntax highlighting .json file does nothing (WINDOWS, UNITY 5.3.1p1) 2 Answers

optional function parameters in javascript and c# 4 Answers

class, function and variable capitalisation 3 Answers

Syntax prob, UCE0001 error c#sharp to javascript 1 Answer

Far Clipping Range syntax 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