Search Unity

A new learner question.Unity/Mono/Dotnet version - C# 7/10 - VS2019/2022

Discussion in 'Getting Started' started by Egitimhesabi, Sep 8, 2022.

  1. Egitimhesabi

    Egitimhesabi

    Joined:
    Jul 25, 2022
    Posts:
    1
    Hello
    I'm currently trying to learn Unity, but I have some questions I'd like to ask. At first I started by learning C#, I understood it theoretically, but I am aware that I need to develop a project to be able to abstract. Something is confusing to me, C# is currently at version 10 and dotnet is on version 6, but I found out that Unity uses an infrastructure called mono and supports dotnet 4.7 and C# 7. During my C# learning, and I used VS2022 while learning C#.Will the scripts I use in C# 10 create incompatibility?. Do I need to use visual studio 2019 or lower to use Unity now? Do I need to do any downgrades? what are your suggestions?
     
  2. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    Welcome!

    New versions of C# include new functionality. Generally, it's either more advanced features or simpler ways of doing things compared to older versions. As long as you're using an IDE that has Intellisense (Visual Studio, VS Code, Rider, etc), you'll know if your code will work or not as you're writing it. And if not, you'll be able to tell when you save your files and Unity recompiles your code. If you're trying to use features not available to the version of C# your Unity version is using, you'll get compiler errors in your console telling you exactly where to look. There's always a way to do anything you can do in newer versions... you just might have to write a bit more code to do it differently.

    Best advice I can give at this stage is to throw caution and theory to the wind, get in there, and start making things. You're gonna write a ton of bad code, and that's fine. You'll get better and better at it each time, and before you know it, you'll feel competent enough to start making an actual game.

    Good luck!
     
    Egitimhesabi likes this.