- Home /
Does Unity Script syntax change from release to release? If so how much?
Does Unity Script (JS), C# or Boo syntax change from release to release? If so how much?
I would like to be aware of outdated material while learning from tutorials.
Answer by Waz · Aug 31, 2011 at 07:21 PM
Not much. UnityScript has improved slightly each release, but mainly in things like adding support for Generics. C# changes as Mono catches up / follows Microsoft, so for example it now supports "var".
As for the library of components, sometimes improvements are added that make usage easier, so older tutorials may describe an over-complicated way to do something (eg. Physics.IgnoreCollisions vs. new physics layer-based collisions).
I would always recommend that any component you learn about from a tutorial you also read the current reference documentation for that component too.
$$anonymous$$akes sense to check the current reference documentation when following older tutorials. Thanks.
Answer by Eric5h5 · Aug 31, 2011 at 09:52 PM
It depends on the release. Sometimes there are no changes, sometimes there are big changes (Unity 2.6 -> 3.0 being the biggest). Primarily with UnityScript, since it's a custom language. Best thing is to read the release notes. For example, in Unity 3.4, GetComponent(X) returns type X now instead of Component.
thanks. I will be sure to read the release notes every new release as well as past ones.
Answer by dibonaj · Aug 31, 2011 at 06:40 PM
I haven't noticed if it has. I would imagine it would be hard. C# syntax is C# syntax, that is not something Unity controls. For instance, UnityScript is just .Net with JavaScript syntax laid over it.
I honestly haven't been using Unity that long. Since 3.2, whenever that was. That being said, I have seen tutorials and such that were written for 2.x and syntactically they look the same. They do make improvements under the hood quite frequently. And some of those do change how things work when scripting, but for the most part syntax remains the same.
Always check out the "What's New" section when a new version comes out. It breaks everything down piece by piece to explain the differences. And this includes syntax.
Answer by TrafficEXP · Aug 19, 2014 at 09:14 AM
working with unity for about one and a half years, when starting out this was an issue for me, so frustrating to follow tutorials, not knowing the errors that popped up were due to version issues! just going to repeat this other good advice, check 'what's new' for each version just to check!