How to attach Unity Debugger in VS Code?

Hi, I am using Unity2019.4.19f1 and VS Code 1.52.1 on Ubuntu 20.04. I have installed the "Debugger for Unity " extension and now I am trying to attach it to my project in my VS Code editor to be able to use breakpoints, etc. However, the instructions in the extension page seem to be for an earlier version of VS Code (you can see that the left-side toolbar in the doc doesn’t fit the one in my editor):

alt text

alt text

I don’t see the Unity Debugger in the list with “.NET Core Attach” and “Node.js (preview)…” nor in the modification suggestions in the Launch.json file when I click on “Add Configuration…”.

How can I attach the Unity Debugger to my project? Is there an updated tutorial or documentation somewhere?

Thanks!

Your image links are broken, however, you should be able to create a launch.json file, then pick Unity, then save it and be all set. I can only add the two images, but the third one is a JSON file that you need to save. This sets up the debugger config and then you’ll be able to attach the debugger to Unity and go.

176088-vscode-unitydebugger1.png

176089-vscode-unitydebugger2.png

@WeirdBeardDev thanks! I added this to my launch.js and it worked :slight_smile:

{
    "name": "Unity Editor",
    "type": "unity",
    "request": "launch",
    "processId": "<path-to-project>/Library/EditorInstance.json"
}

Don’t forget the Debug setting in Project Settings > Player > Debug

If it still doesn’t attach all the time, don’t forget to set omnisharp.useModernNet to false in the Open User Settings. (you can also do it in the settings.json file)