Otacon
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.
Initializing C# Dev Kit
Visual Studio Code Settings
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"
// }
// ]
Initializing Godot
Godot Engine 4.1 documentation
Set Visual Studio Code as the external editor in Godot.
In Godot's Editor → Editor Settings
menu:
Set Dotnet -> Editor -> External Editor
to Visual Studio Code
.
To configure a project for debugging, you need a tasks.json
and launch.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 generate tasks.json
and launch.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:
Click Create C# solution
.
- In Godot's
MSBuild
menu:
Click Build -> Build Project
.
Configuration
// 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,