Switch to the Godot engine; if you are still using the Unity engine, please do not update.
If you accidentally updated, please revert to version 1.4.0.
Add some configuration options to the settings.json file, as shown in the following code.
"dotnet.dotnetPath": "$YOUR_DOTNET_INSTALL_PATH",
"dotnetAcquisitionExtension.existingDotnetPath": [
{
"extensionId": "ms-dotnettools.csharp",
"path": "$YOUR_DOTNET_INSTALL_PATH"
},
{
"extensionId": "ms-dotnettools.csdevkit",
"path": "$YOUR_DOTNET_INSTALL_PATH"
},
// If you are still using the Unity engine, add this too.
// {
// "extensionId": "visualstudiotoolsforunity.vstuc",
// "path": "$YOUR_DOTNET_INSTALL_PATH"
// }
]
// Example:
// "dotnet.dotnetPath": "/usr/local/bin",
// "dotnetAcquisitionExtension.existingDotnetPath": [
// {
// "extensionId": "ms-dotnettools.csharp",
// "path": "/usr/local/bin/dotnet"
// },
// {
// "extensionId": "ms-dotnettools.csdevkit",
// "path": "/usr/local/bin/dotnet"
// },
// {
// "extensionId": "visualstudiotoolsforunity.vstuc",
// "path": "/usr/local/bin/dotnet"
// }
// ]
Godot Engine 4.1 documentation
-
Set Visual Studio Code as the external editor in Godot.
In Godot's
Editor → Editor Settings
menu:
SetDotnet -> Editor -> External Editor
toVisual Studio Code
. -
To configure a project for debugging, you need a
tasks.json
andlaunch.json
file in the.vscode
folder with the necessary configuration. An example configuration can be found here.Fortunately, there is a C# Tools for Godot Visual Studio Code extension to make this setup easier and to provide further useful tools.
Use
C# Godot: Generate Assets for Build and Debug
command to generatetasks.json
andlaunch.json
file.How to use command? Follow this.
-
Remember to create a C# solution and build the .NET project.
- In Godot's
Project -> Tools -> C#
menu:
ClickCreate C# solution
. - In Godot's
MSBuild
menu:
ClickBuild -> Build Project
.
- In Godot's
// Editor settings:
"editor.renderWhitespace": "boundary",
"editor.wordWrap": "bounded",
"editor.wordWrapColumn": 120,
"editor.formatOnSave": true,
"editor.formatOnType": true,
// Bracket pair colorization
"editor.bracketPairColorization.enabled": true,
"files.insertFinalNewline": true,