Page cover

Godot

This page shows how to add and use any regular C#/.NET SDK (distributed as a NuGet package or a DLL) inside a Godot 4 project that uses C#. It assumes you’re using the .NET build of the Godot editor.

Prerequisites

Create or enable a C# project

  1. Open Godot (.NET) → create a project

  2. Add your first C# script (Godot will generate a *.csproj for you)

  3. Build once to let Godot restore packages and generate bindings (Godot Engine Documentation)

Add Phantasma Phoenix C# SDK

From your project folder (where the .csproj lives), add the package (PhantasmaPhoenix.Cryptography shown here as an example, check this page for full list of available packages):

dotnet add package PhantasmaPhoenix.Cryptography
dotnet restore

Godot C# uses standard .NET projects, so NuGet packages work the same way as in any C# app (Godot Engine Documentation)

Option B — reference a local DLL

If you have a compiled PhantasmaPhoenix.Cryptography.dll, add a reference in your .csproj:

<ItemGroup>
  <Reference Include="PhantasmaPhoenix.Cryptography">
    <HintPath>addons/PhantasmaPhoenix.Cryptography.dll</HintPath>
  </Reference>
</ItemGroup>

Godot recognizes regular C# project references; external managed DLLs can be added in the .csproj file (Godot Forums, Reddit)

Minimal example

Create Scripts/ExampleSdkUsage.cs and attach it to a Node:

using Godot;
using PhantasmaPhoenix.Cryptography;

public partial class ExampleSdkUsage : Node
{
    public override void _Ready()
    {
       	var keys = PhantasmaKeys.Generate();
        GD.Print($"Address: {keys.Address.Text}");
    }
}

Build the project (from IDE or dotnet build) and run the scene. C# scripts and exported members behave like in regular Godot C# projects (Godot Engine Documentation)

Exporting the game (with C#)

  1. Install export templates in Godot

  2. Configure an export preset (Windows, Linux, macOS, Android, iOS)

  3. Export your build

See Exporting projects in the official docs for platform setup and templates (Godot Engine Documentation)

Note: Web (HTML5) export with C# is not supported in Godot 4.x at the time of writing (Godot Forum)

Tips & troubleshooting

  • Make sure your project targets net9.0 in the .csproj when using Godot 4.4 packages:

    <PropertyGroup>
      <TargetFramework>net9.0</TargetFramework>
    </PropertyGroup>

    Details: GodotSharp packages moved to .NET 8 in 4.4 (Godot Engine)

  • If NuGet restore fails, verify your NuGet configuration or regenerate NuGet.Config (common fix for Godot.NET.Sdk not found) (Reddit)

  • Godot uses the Godot.NET.Sdk MSBuild SDK in your .csproj (managed by Godot) (NuGet)

  • General C#/.NET how‑to for Godot (language features, exports, etc.) is covered in the official C# docs (Godot Engine Documentation)


Last updated