- Home /
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):
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!
Answer by WeirdBeardDev · Feb 16, 2021 at 05:43 PM
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.
Here is what the config file looks like.
And then you get the debugger sidebar like so.
Answer by julienroyd · Feb 16, 2021 at 07:52 PM
@WeirdBeardDev thanks! I added this to my launch.js and it worked :)
{
"name": "Unity Editor",
"type": "unity",
"request": "launch",
"processId": "<path-to-project>/Library/EditorInstance.json"
}
Answer by RChrispy · Apr 26 at 08:23 PM
Don't forget the Debug setting in Project Settings > Player > Debug