A multiplayer sample project built with Godot (C#/.NET) and Nakama.
This project demonstrates:
- Authentication with Nakama
- Match join/host flow
- Multiplayer peer bridging (
NakamaMultiplayerPeer+NakamaMultiplayerBridge) - RPC-based gameplay communication
- Player authority assignment per peer
- Basic chat, group, and storage examples
Before running the project, install:
- Godot 4.6 .NET (or compatible 4.x .NET version)
- .NET SDK 8.0+
- A running Nakama server
Optional but recommended:
- Git
- VS Code (or JetBrains Rider)
git clone <your-repository-url>
cd Nakama-cSharp-TutorialThis project uses NuGet packages (including NakamaClient).
dotnet restoredotnet add package NakamaClientIf you want to pin the version used by this project:
dotnet add package NakamaClient --version 3.21.2The project also uses Newtonsoft.Json:
dotnet add package Newtonsoft.Json --version 13.0.3Open the project in Godot and select the NakamaClient node (script: NakamaClient.cs).
Set exported fields as needed:
NakamaScheme(example:http)NakamaHost(example:127.0.0.1)NakamaPort(example:7350)NakamaKey(example:defaultkey)
- Open project in Godot.
- Build C# solution when prompted.
- Run the main scene.
dotnet buildThen run from Godot editor.
- Start Nakama server.
- Launch two game instances.
- Login with two different users.
- In both clients, use the same lobby name and click Join.
- Click Ready/Start.
Expected behavior:
- Both players are created in the scene.
- Authority is assigned to each player peer.
- No
MultiplayerSynchronizermissing-node startup errors.
NakamaClient.cs- login, matchmaking, ready/start, and high-level network flowNakama/NakamaMultiplayerBridge.cs- maps Nakama match traffic to Godot multiplayerNakama/NakamaMultiplayerPeer.cs- customMultiplayerPeerExtensionSceneManager.cs- player instantiation and authority setupCharacterController.cs- movement logic with authority checks
Run:
dotnet restore
dotnet nuget locals all --clear
dotnet restoreMake sure your .NET SDK is 8.0+:
dotnet --versionCheck:
- Server is running
- Host/Port/Scheme/Key values in
NakamaClientexports - Firewall/network access
This project is provided under the terms in LICENSE.