Search Unity

Visual Studio 2019 Setup

Discussion in 'Getting Started' started by squarelife, Jun 30, 2019.

  1. squarelife

    squarelife

    Joined:
    Nov 8, 2017
    Posts:
    41
    Hi,

    Please Help me setup this software. I have looked around and got frustrated so I am asking here for help.

    I installed the latest version of unity 2019.3.0a7. I got visual studio too through the Unity HUB.

    I am used to MonoDevelop. I write my Code, I press compile, check for errors, compile again and go back to unity.

    Visual Studio makes no sense.
    What is this Green Play button? Why does it have ATTACH next to it? What should I attach?

    How do I compile my code. How do I setup visual studio.(I Installed it right, got the unity package with it)

    WHy can't I find a tutorial about this?

    Please help.


    devenv_ke1uDHUO2u.png




    cHKpBhCwGq.png


    Untitled.png


    svN2gnFf8f.png
     
    Last edited: Jun 30, 2019
    baxnaruephon1704 likes this.
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    You don't necessarily have to compile inside Visual Studio. If the code files (*.cs) are located in the Unity project, just switching over to Unity should trigger a recompile. Otherwise in Visual Studio "Build > Build Solution" should compile it too.

    It should read "Attach to Unity" actually. Perhaps you're missing the "Visual Studio 2019 Tools for Unity". It allows you do attach to the Unity Editor and Player to debug.

    upload_2019-6-30_11-56-16.png

    If you go to the Visual Studio Installer and choose "Modify", make sure the "Game development with Unity" option is ticked.

    upload_2019-6-30_12-1-32.png
     
    Ryiah and Vryken like this.
  3. Vryken

    Vryken

    Joined:
    Jan 23, 2018
    Posts:
    2,106
    One other thing to add:
    This is an alpha version of Unity.
    If you're looking for the latest stable release, that is currently version 2019.1.8.
     
    Ryiah likes this.
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,190
    Once you've made the modifications to a script you need to make, you save the script and refocus Unity. After Unity gains focus it will compile the script(s) you've modified as well as any other scripts that are required.
     
  5. squarelife

    squarelife

    Joined:
    Nov 8, 2017
    Posts:
    41
    Thank you for the help.
    I got another version of unity and it works fine.

    I still dont know what attach to unity means.
     
  6. Vryken

    Vryken

    Joined:
    Jan 23, 2018
    Posts:
    2,106
    It enables you to use Visual Studio's debugger tools when troubleshooting undesired behaviors with scripts.
    Simply add a break-point in a script, switch to Unity and enter play mode, then perform an action that triggers the break-point.
    Unity will pause and you will be able to step through your code line-by-line while viewing the current values of fields to see if they are or are not what you expect them to be.
     
  7. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
  8. squarelife

    squarelife

    Joined:
    Nov 8, 2017
    Posts:
    41
    Thank you.
    I appreciate it.
     
  9. unity_007fkj

    unity_007fkj

    Joined:
    Mar 23, 2019
    Posts:
    9
    I see lots of beginners asking VS2019 installation guide. Here is the guide, you need to select Game development tools for unity3d. Watch this:
     
    MFKJ likes this.
  10. ahmedaniss

    ahmedaniss

    Joined:
    Sep 18, 2019
    Posts:
    98
    setup visual studio for unity here