How to Add C# Assemblies to a Godot Engine Project

With the release of version 3.0 of the Godot Engine, C# was added as a supported programming language. Due to other engines like Unity, there is a large number of C# assemblies which can help in developing a game. However, there isn’t an easy way to add assemblies in the editor. Therefore, this tutorial was created to help with that problem.

In this tutorial, we’ll use the Godot Engine, version 3.0, along with the assembly for Rant. Note that while a C# assembly can be added to the editor, the assembly cannot be exported to a self-contained executable just yet.

1. Create project as normal. Where necessary, add a C# script. At first, the engine will generate the necessary C# files (i.e. the “*.csproj” and “*.sln” files).

2. Add in the C# code. After this, close the editor for the moment.

3. Ensure that the correct assembly is in the Godot project working directory.

4. Go into a desirable IDE and open up the “*.csproj” file which was created when the C# script was added. Monodevelop will be used in this tutorial. At this point, ensure that the Godot editor isn’t running. Otherwise, key files may be overwritten.

5. In Monodevelop, right-click on the References node in the tree view for the project and click on Edit References... Be sure to first expand the project so as to reveal References. Then click on the .NET assembly tab and click “Browse…”.

6. Select the desired assembly for the project and then click “Open”.

7. It should then be added as a reference for the project. Click “OK” and save the project (“Ctrl + S” or “File -> Save”). Exit out of the IDE and go back into the Godot editor.

8. Add in a GDscript which makes use of the assembly.

9. If all goes well, the engine should use the assembly in the resulting game.

If you have any comments or questions, please ask them below, or get in touch with me.

Jason Anderson

I'm a man who likes to tinker and learn about things, mainly things of a technical nature. Mostly I work on free and open source software like Linux, but I have other pursuits. Currently, I'm working towards a career in information systems auditing. While I have an education in accounting (with a BBA in accounting), I am looking into jobs that involve information systems auditing.

Leave a Reply

Your email address will not be published. Required fields are marked *