Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Can't get Unity to find VSCode. Unity showing /usr/sbin rather than /usr/bin

Discussion in 'Linux' started by Randlcornel, Oct 14, 2023.

  1. Randlcornel

    Randlcornel

    Joined:
    Jan 14, 2018
    Posts:
    5
    Linux newbie here trying to migrate Unity from Windows to Linux (Pop OS). I'm having problems getting VSCode to work with Unity. I've loaded VS code a number of different ways (debian & flatpack via the Pop OS store as well as from the official VS Code web page located here https://code.visualstudio.com/docs/other/unity), added the Unity extension to VS Code, and in each case can run VS Code stand alone with no errors. The code is located at /usr/bin/code. Unity has the Visual Studio Editor installed (2.0.22). The Visual Studio Code Editor package is not installed. I've tested this on both 2021 LTS and 2022 LTS versions of the Unity editor.

    The trouble comes when I try to link Unity to VS Code. Going to Preferences/External Tools, Unity only shows the generic Visual Studio Code entry. Trying to browse and navigating to /usr/bin/ actually brings up the contents of /usr/sbin/ which doesn't have "code". Therefore, I can't link VS Code to Unity. Interestingly, using the "Show In File Browser" button the the Unity Hub and navigating to /usr/bin/ shows the actual contents including "code".

    Any sudo the voodoo that you do so well would be much appreciated.
     
  2. ChiwTheNeko

    ChiwTheNeko

    Joined:
    Mar 24, 2022
    Posts:
    141
    You need it. Install it. That should fix your problem.

    Also If you install VS Code with flatpak then it might not be detected by Unity. Hopefully this problem should be fixed soon but until then you should install VS Code with the official package. If your VS Code is installed in /usr/bin then it should be good.
     
  3. Randlcornel

    Randlcornel

    Joined:
    Jan 14, 2018
    Posts:
    5
    ChiwTheNeko, thanks for your kind and quick response.

    Sadly, I tried adding the Visual Studio Code Editor package and it still didn't work. I'm using the VS Code installed from the page linked above (not FlatPak). I think that's the "official" package. BTW, that page has the following comment "Note: The Visual Studio Code Editor package published by Unity is a legacy package from Unity that is not maintained anymore." ???

    Thinking about a fresh install of Pop OS as a next step...
     
  4. ChiwTheNeko

    ChiwTheNeko

    Joined:
    Mar 24, 2022
    Posts:
    141
    WTF? Just a few weeks ago I talked with a Unity dev on this forum about fixing it so that it detect Flatpak installs of VS Code. And it isn't maintained anymore?

    Anyway, I'm not sure I understand what your problem is exactly. You said you get the VS Code option when you go into Preferences -> External Tools. So what is the problem then?
     
  5. Randlcornel

    Randlcornel

    Joined:
    Jan 14, 2018
    Posts:
    5
    Okay, I finally got it to run (Unity to find VS Code in Preferences/External Tools). To recap, on Pop OS, regardless of what VS Code I downloaded, Unity was steadfastly refusing to locate VS code at /usr/bin/code or anywhere else.

    Solution: Deleted Unity Hub, which I had installed via the Pop OS store, and loaded it directly off the Unity site. I also avoided both versions of VS Code available on the Pop OS store and loaded VS Code from here...
    https://code.visualstudio.com/docs/other/unity
    ...using it’s recommended link here…
    https://code.visualstudio.com/
    ...to download the .deb version.

    This worked on Unity editor 2022.3.11f1 with Visual Studio Editor v2.0.21 installed. Additionally, I note that Visual Studio Code Editor 1.2.5 is also installed (included in the Engineering package).

    And I was so looking forward to switching over to Godot!

    Thanks for the help, ChiwTheNeko.
     
  6. tylerinthezoo

    tylerinthezoo

    Unity Technologies

    Joined:
    Jun 15, 2022
    Posts:
    97
    The sentence means the new package is now developed by microsoft for unity, https://forum.unity.com/threads/microsoft-previews-unity-extension-for-visual-studio-code.1468913/, which is called "visual studio editor" instead of the old name "visual studio code editor". Last time i managed to submit a patch for this package to microsoft and they took it.
     
    Last edited: Oct 16, 2023
  7. EEddie4

    EEddie4

    Joined:
    May 4, 2023
    Posts:
    2


    We're in this together bud. I'm on Fedora 38 and the old method was working for me but upon an update EVEN with Visual Studio Editor enabled, I only get the generic "Visual Studio Code". I tried building from the VS Code directly from the site but all to no avail.

    Things seem to be getting tougher for anyone considering Game Dev on Linux.
     
  8. ChiwTheNeko

    ChiwTheNeko

    Joined:
    Mar 24, 2022
    Posts:
    141
    What else did you expect to get? What's not working?