Hi
Just a quick question - i am following some tutorials on youtube (im a beginner) and im writing scripts in javascript and words like:
function OnTriggerEnter are highlighted in orange on the tutorial video dont on mine, have i got my script editor set to the wrong programming language or do i have to configure it in some way?
Its not a major issue but it would be helpful if my code highlights properly especially since im just starting off.
Unity comes with the “MonoDevelop” editor on Macs and Windows, but also includes the older “Unitron” editor on Macs. (This was the default editor in older versions of Unity and some developers still prefer it as it loads very quickly. It’s less powerful than MonoDevelop though.)
On Windows, Unity will also talk to Microsoft’s industrial-strength code editor called “Visual Studio”. As the “C#” programming language supported by Unity was originally created by Microsoft, it’s not a big surprise that Microsoft’s Visual Studio editor is often preferred over the slower, clunkier, MonoDevelop.
Visual Studio is to MonoDevelop what MonoDevelop is to Unitron.
There are also other code editors on the Mac, like BBEdit and Sublime Text. (You might have spotted the “How to get Unity working with Sublime Text 2” thread in these forums.)
Basically: don’t worry about it.
If you’re using MonoDevelop, which is the default code editor, it should do the syntax highlighting—this is the “show the keywords, variable names, etc. in different colours” feature—and also “autocomplete”, where it makes an educated guess at what you want to type and offers to complete entire function names and variable names for you.
Ahhhh well the guy on the tutorials is using a mac and im using windows that might be why. I assume I am using MondoDevelop since im using the latest version of unity and thats the default.
Its not bothering me too much since my code still works but its just annoying when i see his code highlights and mine doesnt - makes me think i’ve mistyped something when i havent. Plus obviously when your writing alot of code I find highlighting really helpful.