What is more to be used C# or JavaScript?

Hey,

I am new here. I was just wondering what is to be more used C# or JavaScript? I want to find tutorials also so I can learn.

Also, are there any tutorials out there for me to learn Unity? I mean a good series?

*If I have posted this in a wrong board, please move it. I am here here. Also, I posted here because I wanted to introduce myself also…

Hello Raahim and welcome.

There are many threads in this forum to do with this subject so i wont go into it. My opinion is you’re better off learning C# than “unity script”
(similar to javascript)

Here is a link to some C# only video tutorials

I had started a poll on this a while back:

http://forum.unity3d.com/threads/18507-Boo-C-and-JavaScript-in-Unity-Experiences-and-Opinions

C# only wins with 39%, JavaScript (UnityScript) only comes second with 29% … both is third at 25% … the poll is still open, so results may change over time

Both will give you good experience. However using C# will enforce better coding practices, and has more direct application outside unity. It is also a richer language (delegates, extension methods, LINQ, etc), though I believe Unity has been updating US to try to bring it up to par with C#. All the new tutorials that unity is doing are being written in C#. And there are many more resources on the web to learn also. I recommend using C# if you have no preference or are just learning. With that said, US is not a bad choice, so pick the one you feel more comfortable with.

Hi there,
I’ve been teaching programming for over 20 years, and game programming for the last 10 - I switched from Flash Action Script to Unity C# four years ago.

If you’re just learning Unity for fun/personal projects, either language is fine. If you’ve been more a non-scripting designer up to now, you might find UnityScript a bit friendlier as a first game scripting language.

However, if you’re learning Unity programming with a view to developing medium to large projects, and/or you’re likely to be working with other programmers, and if you see yourself going down the software development path as a career, I’d recommend you start with C# and stick with it. C# is a modern, object oriented programming language that encourages/forces you into programming conventions like having to choose and stick with the data type for your variables, only making properties public if you do so explicitly, and writing classes and methods and ‘code’ in general that will let you easily move onto other languages like Java, C++ and object oriented PHP very comfortably.

Unless I’m teaching multimedia designers, my only choice for Unity is C#.

my unity book has all code examples in C#, since that’s where every serious Unity developer ends up, even if they started with UnityScript

Having learned programming in the 80s with BASIC, assembly, COBOL and Pascal, I can appreciate that modern languages like Java and C# take a bit if getting used to if you’re new to object oriented programming, let alone if you’re new to programming anything at all. But once you’ve got the fundamentals it all starts to make sense, and you can start designing and developing reusable and self-contained software components for games (e.g. pickup objects with their own icons and properties, NPC ‘droid’ behaviours, countdown timers objects, even game ‘state’ sub-classes), and you can see all the benefits of the OO way if doing things.

what is great now, is that there are so many tutorials and resources to help you learn Unity programming - it was a bit harder some years ago when, apart from Will Goldstone’s excellent book, there wasn’t much around to help people get started.

One way to learn a language is to see (and use, and modify for your own uses) lots of little examples of how to create game features using the language you are learning. These forums are a good source, and the unity wiki, and (modest cough) hopefully the new Unity cookbook Chico and I have just published will also be a good start, or continuation, for people learning C# unity programming.

… Matt Smith …

bump

Oh god… antenna tree responded to your new poll thread try to explain that there are already many threads on this issue, and instead of continuing from the most recent of them, you go and bump each of them? Oh no MoHoe.

Matt Smith, your book is god awful…I do not recommend it to anyone! It’s a waste of 25-40 bucks. The book tells you what you can do and then provides the scripts…but he doesn’t go over the scripts…for instance, this is in his stupid book.

public class PictureInPicture: MonoBehaviour {
    public enum HorizontalAlignment{left, center, right};
    public enum VerticalAlignment{top, middle, bottom};
    public HorizontalAlignment horizontalAlignment =
HorizontalAlignment.left;
    public VerticalAlignment verticalAlignment =
VerticalAlignment.top;
    public enum ScreenDimensions{pixels, screen_percentage};
    public ScreenDimensions dimensionsIn = ScreenDimensions.
pixels;
    public int width = 50;
    public int height= 50;
    public float xOffset = 0f;
    public float yOffset = 0f;
    public bool  update = true;
    private int hsize, vsize, hloc, vloc;
    void Start (){
           AdjustCamera ();
    }
    void Update (){
           if(update)
                 AdjustCamera ();
}
    void AdjustCamera(){
           if(dimensionsIn == ScreenDimensions.screen_percentage){
width);
hsize = Mathf.RoundToInt(width * 0.01f * Screen.
vsize = Mathf.RoundToInt(height * 0.01f * Screen.
height);
           } else {
                 hsize = width;
                 vsize = height;
}
           if(horizontalAlignment == HorizontalAlignment.left){
                    hloc = Mathf.RoundToInt(xOffset * 0.01f *
Screen.width);
             } else if(horizontalAlignment == HorizontalAlignment.
right){
Chapter 2
29

Using Cameras
                           hloc = Mathf.RoundToInt((Screen.width - hsize)
       - (xOffset * 0.01f * Screen.width));
                    } else {
                           hloc = Mathf.RoundToInt(((Screen.width * 0.5f)
       - (hsize * 0.5f)) - (xOffset * 0.01f * Screen.height));
                    }
                 if(verticalAlignment == VerticalAlignment.top){
                           vloc = Mathf.RoundToInt((Screen.height -
       vsize) - (yOffset * 0.01f * Screen.height));
                    } else if(verticalAlignment == VerticalAlignment.
bottom){
                           vloc = Mathf.RoundToInt(yOffset * 0.01f *
       Screen.height);
                    } else {
                           vloc = Mathf.RoundToInt(((Screen.height *
       0.5f) - (vsize * 0.5f)) - (yOffset * 0.01f * Screen.height));
} }
    }
  camera.pixelRect = new Rect(hl

He then proceeds to the next chapter…doesn’t explain any bit of the code, nor let you write the code yourself.

Idiotic if you ask me.

I hope your sales fail.

Buyers beware.

Best,

SubZeroGaming :slight_smile: