Install system dependencies:
brew install --cask mono-mdk dotnet-sdk godot-mono
brew install mono
$ which dotnet msbuild mono
/usr/local/bin/dotnet
/Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild
/Library/Frameworks/Mono.framework/Versions/Current/Commands/mono
Start Godot and create a project (e.g. $HOME/godot/hello
).
Add a C# script to a node. This should generate hello.sln
and hello.csproj
files.
Set Editor > Editor Settings > Mono > Editor
, so VSCode will be started when double-clicking script files.
Over to VSCode. Install the following extensions:
Open the project:
code $HOME/godot/hello
Uncheck OmniSharp: Use Modern Net
or add this to your settings.
"omnisharp.useModernNet": false
Follow the prompts to restart OmniSharp.
At this point, IntelliSense should work for standard types and namespaces, e.g. List
and System.Collections.Generic
.
If it doesn't, open the Output view and look at the C# and OmniSharp Log sections, and try to fix the errors there.
Once basic IntelliSense is working, start Godot in a separate terminal.1
/Applications/Godot_mono.app/Contents/MacOS/Godot --path "$HOME/godot/hello" -e
Click Build
in the top-right corner.
Switch back to VSCode, Restart OmniSharp
, and IntelliSense should work for Godot APIs like GD.Print
.2
Debugging seems to just work. Select View: Show Run and Debug
and click Play in Editor
on the left.
Other resources:
- Visual Studio Code and C# code completion and debugger for Godot (nice concise guide with screenshots, but some parts are outdated or have missing details)
- Official guide
Godot invokes
msbuild
, so this is just to ensure it is started in the appropriate environment. Alternatively, selectGodot Tools: Open workspace with Godot editor
from the command palette after configuring the path to the editor in the workspacesettings.json
, and this will be done for you in a terminal in VSCode.↩︎"godot_tools.editor_path": "/Applications/Godot_mono.app/Contents/MacOS/Godot"
In the status bar, you should see a flame icon indicating "OmniSharp server is running", and a "Connected" section indicating the GDScript language server (provided by Godot itself) is running. ↩︎