Unity - Script Languages

Started by
12 comments, last by Orymus3 9 years, 1 month ago

You seem to know about this smile.png (OO = OOP?, Object Oriented Programing?), I'll note all you said and give it another read when I have a proper understanding of this subject, because at the moment I'm having a hard time understanding all that, but thanks again!, any useful information is always welcome

Sorry, dude, sometimes I get ahead of myself and forget to make sense in my posts ;)

Yes, OO = OOP... I like to drop the P as Object Orientation is IMO only really used in programming anyway, but yeah, it is the same thing.

The other things I was talking about is the way Unity likes to handle things, which is component based programming:

http://en.wikipedia.org/wiki/Component-based_software_engineering

http://thrysoee.dk/InsideCOM+/ch01b.htm

You have GameObjects as your base Game Entities, like for example a player character, or a vehicle, or a gun. Or a camera....

This GameObject has Components that are attached to it... like the graphical mesh, or a mouse controller script, or a locomotion script.

This GameObject - Components relationship is not REALLY OOP... it is a different way of tackling the same problem. It is not bad at all, it actually makes a ton of sense in a game engine like Unity.

Its just that C# is an OOP language, and for someone that worked in OOP for a long time, the shift to Component base programming and using both things in parallel can be quite confusing. And its good for newbies that understand enough to start worrying about such things to know about both worlds and be able to distinguish them.

But don't worry if doesn't make much sense to you now. Just start programming and learn the language, all other things will make sense over time.

Advertisement
As mentioned by other users, C# has become the most accepted language for Unity for a variety of reasons.

Not least of which being parity with Mono .NET - giving you access to the most powerful multiplatform libraries available in game development.

Also factor in the much cleaner code and strict typing in C# and you will find your Unity games have fewer and easier to resolve bugs when using this language over Unityscript.

Finally, using C# in Unity, you will inevitably learn .Net and true C# which will also open up future opportunities for you outside of Unity and game development in general.

Add another vote to the C# bucket.

While Unity currently has support for other languages, all the languages boil down to .net bytecode (more properly CIL or CLI) that gets run by the mono engine. That compiled stuff, the Common Intermediate Language, has a very nearly perfect mapping to C#.

The other languages generally do not add any transformative operations that make things easier, although you might happen to have a specific operation that you know how to easily implement in that other language. For those few things where a different language lends itself to the solution then the other language may be a good idea, otherwise, C# is the typical choice.

Everyone uses C# in Unity...

Aside from its intrinsic value and the fact that it is a typed script, it's also much easier to find help around the web (script examples) when looking for their C# counterparts (would be much harder to find anything else as a matter of fact). So, if you have no preconceived notion as to which script to use, C# is perfect.

This topic is closed to new replies.

Advertisement