Search Unity

Looking to get into Unity and Game development in general

Discussion in 'General Discussion' started by Fudegracoon, May 28, 2020.

  1. Fudegracoon

    Fudegracoon

    Joined:
    May 28, 2020
    Posts:
    13
    So, currently I'm majoring in computer engineering and towards the end of my first year. Till now I've learnt C/C++ and took my 3 courses in programming one being a beginner's class the second being sort of an intermediate one and data structures currently. I haven't been relaying on university at all and been researching and learning stuff on my own. I know STL and I've learnt alot about linked lists, queues, stacks, graphs, trees and hashtables. In the summer I'll be reading and practicing on object oriented programming and more advanced stuff in C++. I'm aware that unity uses C#, so after I'm done with all this I'll start learning C# and getting familiar with the synatx. Now comes my question, will I have a tough time learning C# and using unity and utilizing what I've learnt so far? Also I failed to mention that ai have a bit of experience with blender and made multiple decent projects with it, so how are things looking for me?
     
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,573
    If you were deep into C++, and very used to it (few years of practice), then you could feel some confusion upon encountering Equals() in conjunction with overloading operator==.
    C++ has distinction of value and pointer to it, while C# has ambiguity when it comes to operator== and Equals(), as it is not immediately obvious which one should compare if the values are the same and which ones should check if the OBJECT itself is the same.

    Given that you're relativley new, however, you should be fine, and there should be a lot of similarities.
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    In many ways C# is very similar yet easier than C++. They both share a "C style" syntax, even though some minor tweaks are needed here and there compared to writing the same thing in C++. Some of the biggest differences are with pointers and memory deallocation. In C# you generally just don't use pointers, and you generally just don't need to deallocate memory. C# makes extensive use of references, and when you no longer reference something taking up memory the garbage collector comes along and frees the memory for you.

    On things like linked lists, it is rare for you to need to create something like that yourself in C# for Unity development. Probably 99%+ of your collection needs can be solved with a List<T>, array, or dictionary, instead of some more exotic data structure.

    Really the hardest thing with Unity then becomes just learning Unity and the Unity way of doing things, and it is really not all that hard to learn.

    Basically a Unity project is organized into different scenes. You can have 1 or more scenes running at the same time, but it is good to start with just a single scene running at a time for your first project. Scenes contain GameObjects, and attached to GameObjects are Components and other child GameObjects. These can be seen in the scene Hierarchy when the scene is loaded. GameObjects each have a Transform, which includes its position in 3D space, and any number of other Components you can attach to add whatever behavior or functionality you want to the GameObject. You create your own custom Components by writing a C# script where the class inherits from MonoBehaviour. Most code you see posted in the documentation or on the forums will be from a MonoBehaviour script, usually just called "scripts". Your scripts talk to other scripts or built in Unity Components via references. Some of the work you want to do in your scripts you will want to repeat every frame, and you'd put that in the special Update() method in your scripts.

    I suggest skimming through the Unity manual so you're aware of many of the Unity concepts, and what functionality Unity includes for you which you can leverage rather than reinventing the wheel. Running through some tutorials isn't a terrible idea either. Lots of them available on YouTube, as well as in the Learn section here. If you use YouTube ones make sure they are recent, as Unity has made lots of changes in the last half decade. Good luck!
     
    angrypenguin and Fudegracoon like this.
  4. Fudegracoon

    Fudegracoon

    Joined:
    May 28, 2020
    Posts:
    13
    Thank you soo much! That was really informative. And definitely will be picking up some unity courses, I got my eyes on a couple on udemy.
     
    Joe-Censored likes this.
  5. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Just one last thing. You can get a lot accomplished in Unity with just knowing the basics of C#. Of course more advanced knowledge will be helpful, but it certainly isn't necessary to get started. Good luck!
     
  6. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Start with DOTS is my advice. It's a far better learning environment. It's closer to the hardware, closer to what C is like actually. It forces you to understand fundamentals because in DOTS you work with them more closely with less abstraction. It will introduce you to concurrency and data oriented design also. All of this is stuff that is more transferable then what you will learn outside of DOTS, which is mostly Unity specific things once you get past a basic grasp of the language.