- Home /
VSCode debugger not attaching to Unity Editor properly
I've come back to Unity after months and discovered that VSCode no longer wants to play ball with Unity. The Debugger for Unity extension is installed and up to date, but when running the Unity Editor launch option, the debugger detaches moments after launching. While playing, none of my breakpoints are hit.
I've tried fiddling with the settings in Unity, but to no avail. The ones I understand to be applicable are as follows:
Build Settings > Build Configuration = Debug
Build Settings > Development Build = True
Build Settings > Script Debugging = True
Preferences > External Tools > External Script Editor = Visual Studio Code
Mode = Debug
The Editor Attaching option is missing entirely, so I can't even enable it.
I'm using Unity version 2020.3.19f1, VSCode 1.61.1, Debugger for Unity v3.0.2, and Windows 10.0.19042
Edit: Added operating system and version
@ImmortalCake7890, did you find a solution? Running into similar. Thanks
Answer by JongokLee · Nov 14, 2021 at 01:52 AM
hi, I have same problem in mac so, i resolved using running vscode as sudo in terminal but, it's not best solution. I hope I can be of some help.
Answer by Snooz · Nov 18, 2021 at 08:46 PM
@JongokLee Your answer about sudo was helpful.
It lead me to head into MacOS System Preferences > Security & Privacy to change the permissions for VS Code. I gave the VS Code application Full Disk Access, and was now able to attach debugging to Unity.
Answer by kurifodo · Jan 14 at 02:59 AM
I had to run Unity in Admin mode to attach the debugger from VSCode.
Answer by ncoonrod · Mar 27 at 02:29 PM
On Linux (might be the same for Mac), I had to download and install Mono https://www.mono-project.com/download/stable/
Your answer
![](https://koobas.hobune.stream/wayback/20220613044226im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to debug a shader? 2 Answers
Debugging - Scale Collectible 0 Answers
Android project debugging.. 1 Answer
How do you see the results of compute shaders in the debugger? 1 Answer