Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved VS Code with Intellisense on Linux Mint 20

Discussion in 'Linux' started by fran_m, Oct 11, 2020.

  1. fran_m

    fran_m

    Joined:
    Jul 22, 2020
    Posts:
    40
    Hi,
    after some struggling with Unity Editor and VS Code I found how to make it work with Intellisense on my Linux Mint 20:

    I did these steps to make it work with Itellisense in Linux Mint 20 Cinnamon (son of Ubuntu 20.04):

    0. I assume you already have Unity Editor running with the latest nvidia drivers installed
    1. Install VS Studio from .deb file (https://code.visualstudio.com/docs/setup/linux)
    2. Open VS Code and install de C# extension OmniSharp (you will be asked to install it when you open VS Code). Afterwards, close VS Code
    2. Install .net SDK from here: https://docs.microsoft.com/es-es/dotnet/core/install/linux-ubuntu#2004-
    3. Install latest Mono release (Ubuntu 20.04): https://www.mono-project.com/download/vs/
    But the next line must be replaced:
    deb https://download.mono-project.com/repo/ubuntu vs-focal main
    for this one:
    deb [arch=amd64] https://download.mono-project.com/repo/ubuntu vs-focal main

    (just added [arch=amd64] )

    4. Open VS Code, go to menu File - Preferences - Settings - Extension - C# configuration
    look for "Omnisharp: Use Global Mono", and set it to "always".
    5. Close VS Code
    6. Go to Unity menu Edit - Preferences - External Tools - External Script Editor, and pick "Visual Studio Code"
    7. In the same window, check "Embedded packages", "Local packages", "Built-in packages", "Git packages" and after click on "Regenerate project files"
    8. I recommend to add the Unity Snippets, for events like OnMouseDown, OnEnterCollider...:
    https://marketplace.visualstudio.com/items?itemName=YclepticStudios.unity-snippets
    9. Also recommend these Unity extensions:
    https://code.visualstudio.com/docs/other/unity


    Hope it helps

    [EDIT 21-10-2020] Interesting extensions
     
    Last edited: Oct 21, 2020
    deatacha, hovardslill and Skade88 like this.
  2. hovardslill

    hovardslill

    Joined:
    Sep 27, 2019
    Posts:
    1
    Thank you!!
    However I had to edit "Omnisharp: Use Global Mono" To "always" to get it to work!!
    Thank you for a great guide! :)
     
  3. fran_m

    fran_m

    Joined:
    Jul 22, 2020
    Posts:
    40
    Thanks for spoting the mistake. On step 4 should be "Omnisharp: Use Global Mono" and not "Mono Path". Now it has been fixed.
     
    Last edited: Oct 18, 2020
  4. Deffo

    Deffo

    Joined:
    Sep 10, 2020
    Posts:
    6
    I followed all the steps, but when I open Unity to set VS Code as External Script Editor, it is not shown. If I click 'browse', Unity can't find the location even if it exists
     
  5. fran_m

    fran_m

    Joined:
    Jul 22, 2020
    Posts:
    40

    New

    Which version os Linux are you using? I assume VS Code is correctly installed right?
     
  6. deatacha

    deatacha

    Joined:
    Feb 28, 2020
    Posts:
    1
    It wasn't shown for me either, and it took a bit of browsing to find where it was located (at least for me, I'm not that familiar with Linux's file structure). I'm using Ubuntu and for me it was located in /usr/share/code. Select the file that's just named "code" and it should work!