Introducing Dragonfly Cloud! Learn More

Question: Which programming language should I use with Godot?

Answer

Godot Engine supports two primary languages for game development: GDScript and C#. Additionally, it supports visual scripting, a node-based system aimed at non-programmers, and has a plugin for support of the Nim language.

GDScript: This is Godot's in-house language designed to be easy to learn and fast to write. It has a Python-like syntax which makes it very accessible to beginners. Here's a simple example of how you define a class and function:

extends Sprite func _ready(): print("Hello World")

C#: After the release of Godot 3.0, C# was introduced as a supported language using the Mono runtime. If you're already familiar with C# or coming from Unity, you might prefer this option. Here's the same example in C#:

using Godot; using System; public class MySprite : Sprite { public override void _Ready() { GD.Print("Hello World"); } }

Choosing between GDScript and C# often depends on your personal preferences or project requirements. GDScript is tightly integrated within Godot, leading to less setup and generally smoother workflow, especially for smaller projects or those specific to Godot. C# may be preferable for larger projects, those requiring more complex algorithms, performance-intensive tasks, or if there's a need to reuse code across different platforms or engines.

Visual Scripting is another option provided by Godot, which uses a drag-and-drop interface to structure gameplay elements. It might be useful for designers or developers who are not comfortable writing code.

Lastly, while less common, Godot also supports using the Nim language through a community-developed plugin. This is an option if you're looking for a language with performance close to that of C++ but with a syntax similar to Python.

In conclusion, GDScript is generally recommended for new Godot users due to its ease of use and deep integration with the engine. C# is better suited for those with experience in statically typed languages, larger teams, or cross-platform codebases. Visual Scripting can be ideal for non-programmers, while Nim provides a niche alternative for enthusiasts.

Was this content helpful?

White Paper

Free System Design on AWS E-Book

Download this early release of O'Reilly's latest cloud infrastructure e-book: System Design on AWS.

Free System Design on AWS E-Book

Start building today 

Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement.