This repository contains the steps needed to enable debugging of Godot 4 projects with breakpoints in VSCode. I am largely using this to help myself remember what to do on future projects, but I'm making it public in case it helps others.
The steps below are taken from this GitHub issue. It is assumed that you already have the Godot VSCode Plugin installed.
- Add
.vscode
to the.gitignore
file of your project. - Copy the
.vscode
folder in this repository to the root of your project.
- In
Editor -> Editor Settings -> Text Editor -> External
, setUse External Editor
toOn
, and point the path to your installed VSCode binary. - In
Editor -> Editor Settings -> Network -> Debug
, set theRemote Port
value to6007
. - In
Editor -> Editor Settings -> Network -> Debug Adapter
set theRemote Port
value to6008
andSync Breakpoints
toOn
.
With Godot Editor open, you should now be able to run the debug command in VSCode and hit breakpoints that you set throughout your code.