xyz ok, let's look at the docs so I don't say this from memory:
https://docs.godotengine.org/en/stable/tutorials/scripting/c_sharp/c_sharp_basics.html
Godot bundles the parts of .NET needed to run already compiled games. However, Godot does not bundle the tools required to build and compile games, such as MSBuild and the C# compiler. These are included in the .NET SDK, and need to be installed separately.
In summary, you must have installed the .NET SDK and the .NET-enabled version of Godot.
you need the NET doodahs and a compiler, as well as an external editor and the NET version of godot.
C# support in Godot's built-in script editor is minimal. Consider using an external IDE or editor, such as Visual Studio Code or MonoDevelop. These provide autocompletion, debugging, and other useful features for C#. To select an external editor in Godot, click on Editor → Editor Settings and scroll down to Dotnet. Under Dotnet, click on Editor, and select your external editor of choice. Godot currently supports the following external editors:
Visual Studio 2022 Visual Studio Code MonoDevelop Visual Studio for Mac JetBrains Rider
external editor because godot supports gdscript only. Then it lists the steps to configure godot for each external editor.
Visual Studio Code¶
After reading the "Prerequisites" section, you can download and install Visual Studio Code (aka VS Code).
In Godot's Editor → Editor Settings menu:
Set Dotnet -> Editor -> External Editor to Visual Studio Code.
In Visual Studio Code:
Install the C# extension.
Note
If you are using Linux you need to install the Mono SDK for the C# tools plugin to work.
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 . In the launch.json file, make sure the program parameter in the relevant configuration points to your Godot executable, either by changing it to the path of the executable or by defining a GODOT4 environment variable that points to the executable. Now, when you start the debugger in Visual Studio Code, your Godot project will run.
Visual Studio (Windows only)¶Download and install the latest version of Visual Studio. Visual Studio will include the required SDKs if you have the correct workloads selected, so you don't need to manually install the things listed in the "Prerequisites" section.
While installing Visual Studio, select this workload:
.NET desktop development
In Godot's Editor → Editor Settings menu:
Set Dotnet -> Editor -> External Editor to Visual Studio.
Note
If you see an error like "Unable to find package Godot.NET.Sdk", your NuGet configuration may be incorrect and need to be fixed.
A simple way to fix the NuGet configuration file is to regenerate it. In a file explorer window, go to %AppData%\NuGet. Rename or delete the NuGet.Config file. When you build your Godot project again, the file will be automatically created with default values.
oh yeah, and the C# extension, you need a C# extension. And MONO SDK for the extension to work. Or maybe that's just for linux, which I'm on.
Warning
You need to (re)build the project assemblies whenever you want to see new exported variables or signals in the editor. This build can be manually triggered by clicking the Build button in the top right corner of the editor.
You will also need to rebuild the project assemblies to apply changes in "tool" scripts.
and here's the button for building the project.