Enhanced Godot 4 tooling with full C# support. Based on godot-vscode-plugin (godot-tools), with additional C# features.
When godotToolsCsharp.lsp.headless is enabled, each VS Code window starts its own headless Godot LSP process for the opened workspace. Opening the same Godot project in multiple VS Code windows can therefore create multiple headless Godot processes.
By default, the extension only starts or connects the Godot LSP when the workspace contains a project.godot file. This avoids spawning Godot LSP processes for plain C#, JavaScript, C++, or other non-Godot folders. You can opt out and keep the previous always-attempt behavior with:
"godotToolsCsharp.lsp.autoDetectGodotProject": falseThe detection signal is project.godot, which is Godot's canonical project file.
Drag nodes from the Scene Preview panel directly into your C# scripts to automatically generate node reference code.
- Open a
.tscnfile to see the Scene Preview in the sidebar - Open your C# script (
.csfile) - Drag any node from the Scene Preview into your script
- Code is automatically generated based on your preferred style
| Style | Generated Code |
|---|---|
| [Export] public | [Export] public Button MyButton { get; set; } |
| [Export] private | [Export] private Button _myButton { get; set; } |
| Lazy field (C# 14) | Button _myButton => field ??= GetNode<Button>("path"); |
| Expression-bodied | Button MyButton => GetNode<Button>("path"); |
- Normal drag → Uses your primary style
- Ctrl + drag → Uses secondary style (shows "[Alt Style]" in preview)
When using [Export] styles (exportPublic or exportPrivate), the extension does more than just generate C# code — it also updates the .tscn scene file to wire up the NodePath automatically.
What happens on drop:
- The C#
[Export]property is inserted into your script - The
.tscnfile is updated with the correctNodePathassignment - A "Rebuild C#" banner appears in the Scene Preview panel
After dropping:
- Click Rebuild in the Scene Preview banner (runs
dotnet build) IMPORTANT: YOU MUST Rebuild from within VSCode before going back to Godot. - In Godot, click "Reload from disk" when prompted
Note:
lazyFieldandexpressionBodiedstyles useGetNode<T>()at runtime, so no scene file modification is needed — they just work.
Set your preferred styles in VS Code settings:
Settings > Godot Tools Enhanced CSharp > C# > Node Reference Style
Settings > Godot Tools Enhanced CSharp > C# > Secondary Node Reference Style
Or in settings.json:
"godotToolsCsharp.csharp.nodeReferenceStyle": "exportPublic",
"godotToolsCsharp.csharp.secondaryNodeReferenceStyle": "lazyField"Options: exportPublic, exportPrivate, lazyField, expressionBodied
Tip: When dropping on an empty line, your default style is used automatically. No dialog needed!
The Scene Preview panel gives you a full view of your .tscn scene tree directly inside VS Code — no need to switch to Godot.
- Search & Filter — Type in the search bar to quickly find nodes by name
- Scene Selector — Use the dropdown to switch between scenes in your project without opening
.tscnfiles manually - Instanced Scenes — Children of instanced scenes are shown recursively, so you can see the full tree
- Node Badges — Visual indicators for script-attached nodes, unique names (
%), and instanced scenes - Lock/Unlock — Lock the panel to a specific scene so it doesn't change when you switch editor tabs
- Drag to Code — Drag any node from the Scene Preview directly into your C# or GDScript files (see Drag & Drop above)
The Scene Preview automatically shows the relevant scene when you're editing:
- A
.tscnfile → shows that scene - A
.csor.gdscript → finds and shows the matching scene (configurable: same folder, any folder, or off)
Configure in settings.json:
"godotToolsCsharp.scenePreview.previewRelatedScenes": "anyFolder"Options: anyFolder, sameFolder, off
View the running scene tree and inspect node properties during C# debugging - features previously only available in the Godot Editor for GDScript.
| Feature | Original Plugin | This Fork |
|---|---|---|
| Active Scene Tree | GDScript only | ✅ Works with C# |
| Node Inspector | GDScript only | ✅ Works with C# |
| Auto-refresh | GDScript only | ✅ Works with C# |
| Search/Filter | ❌ | ✅ New |
Step 1: Add --remote-debug to your launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Play",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${env:GODOT4}",
"args": [
"--remote-debug",
"tcp://127.0.0.1:6007"
],
"cwd": "${workspaceFolder}",
"stopAtEntry": false
}
]
}Step 2: Press F5 to debug. The Scene Tree Monitor auto-starts.
Step 3: Click the eye icon on any node to inspect its properties.
| Setting | Default | Description |
|---|---|---|
godotToolsCsharp.sceneTreeMonitor.port |
6007 |
Port for Godot connection |
godotToolsCsharp.sceneTreeMonitor.autoStart |
true |
Auto-start on C# debug |
godotToolsCsharp.sceneTreeMonitor.refreshInterval |
500 |
Refresh interval (ms) |
Right-click any property in the Node Inspector and select "Edit Value" to modify it at runtime.
Supported types: int, float, bool, string, Vector2, Vector3, Vector4, Color, Transform3D, and more.
Full debug control panel for C# projects:
| Control | Description |
|---|---|
| Pause/Resume | Pause game execution from VS Code |
| Frame Step | Advance exactly one frame (when paused) |
| Live Edit | Modify node properties at runtime |
| Inspector Search | Filter properties by name |
Enable background auto-rebuilding so Godot picks up C# changes automatically — no manual rebuild step needed.
When enabled, the extension starts dotnet watch build in the background. Every time you save a .cs file, it rebuilds automatically and Godot detects the updated assembly.
In settings.json:
"godotToolsCsharp.csharp.dotnetWatch": trueOr: Settings > Godot Tools Enhanced CSharp > C# > Dotnet Watch
Tip: With
dotnet watchenabled, you can skip clicking "Rebuild" after drag-and-drop — just save your.csfile and the rebuild happens automatically.
- Godot 4.2+ (.NET version)
- VS Code with C# extension
- .NET SDK installed
- Download
.vsixfrom Releases - In VS Code:
Ctrl+Shift+P→ "Extensions: Install from VSIX..." - Select the downloaded file
- Check
--remote-debug tcp://127.0.0.1:6007is in your launch.json args - Verify port matches
godotToolsCsharp.sceneTreeMonitor.portsetting - Requires Godot 4.2+
- Make sure you're dragging from Scene Preview (not file explorer)
- Target must be a
.csfile - The Scene Preview panel shows nodes from
.tscnfiles
- After dropping a node with an
[Export]style, click Rebuild in the Scene Preview banner - In Godot, click "Reload from disk" when the dialog appears
- The order matters: rebuild C# first, then reload the scene in Godot
- If you have
dotnet watchenabled, just save your.csfile and wait for the auto-rebuild before reloading
This fork includes all features from godot-vscode-plugin:
- GDScript language support
- GDScript debugger
- Scene Preview
- GDShader support
- And more...
Issues and PRs welcome at github.com/DanTrz/godot-vscode-plugin-csharp
Based on godot-vscode-plugin by the Godot Engine community