Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Linux: C# debugging [solved]

Discussion in 'Getting Started' started by LinuxDevJ, Sep 27, 2020.

  1. LinuxDevJ

    LinuxDevJ

    Joined:
    Sep 26, 2020
    Posts:
    23
    After my first successful Unity test game, I first like to learn how to debug the C# code from Unity. Unfortunately, Unity does not offer an Editor or a Debugger - you have to choose , install, configure one you think is good yourself, alas.

    So I played with VisualStudioCode for Linux as this seems to be the "state of the art" editor for Unity. I managed VSCode to open when I edit a script in Unity. I also updated VSCode to support "C# plugin". But I can't get it to debug! I double clicked a line of code but nothing happens when I "play" the game in Unity.

    Then I read about the free VSCode asset to debug with VSCode:
    https://assetstore.unity.com/packages/tools/utilities/vscode-45320
    https://dzone.com/articles/debugging-unity-3d-with-vscode

    So, I got this in the web browser and see the asset in the web browser of my account. But even restarting my local UNityHub, there is nothing unter "Assets". I wonder how this "Unity Hub" in my browser is connected to the local UnityHub on my local PC. How does this Assets get to my local UnityHub?
     
    Last edited: Sep 27, 2020
    Alderin likes this.
  2. LinuxDevJ

    LinuxDevJ

    Joined:
    Sep 26, 2020
    Posts:
    23
    Well, I never thought this would be so hard to establicsh. No matter what I do, UNity is never showing up this VSCode feature. (https://github.com/dotBunny/VSCode)

    Is there a working setup to be able to debug C# code in Unity? I can't believe that game developer studios use Unity without a proper debugging feature ...
     
  3. LinuxDevJ

    LinuxDevJ

    Joined:
    Sep 26, 2020
    Posts:
    23
  4. larami100

    larami100

    Joined:
    Feb 11, 2021
    Posts:
    2

    Could you please explain me the detailed debugging process? I'm not able to make it work :(

    I installed Unity 2019.4.22 on Ubuntu 20.04 and I have also installed Debugger for Unity plugin for VSCode.

    I double-clicked one of the.cs files of my project in Unity in order to open it with VSCode.

    After VSCode was opened, I selected the green Play button in the .NET Core Attach options list and, in the options appeared to the right, I selected the first "code" option I saw (/usr/share/code/code -g --no-sandbox /home/larami100/shapesMarkerArray/home/larami100/s... (I have attached a screenshot)

    After that, VSCode borders get an orange color but any breakpoint is called if I clicked on the Play button in Unity Editor.

    What I'm doing wrong? I hope you could help me, please.
     

    Attached Files:

    Pnvanol likes this.