Getting Started with Godot for Unity Developers

Are you a Unity game developer curious about Godot? While Unity still dominates the market, Godot is rapidly gaining ground. Exploring multiple game engines can provide invaluable insights into their strengths and weaknesses. Godot, known for its ease of use, open-source nature, and recent 3D enhancements in Godot 4, offers an attractive alternative. By Eric Van de Kerckhove.

Leave a rating/review
Save for later
Share
You are currently viewing page 3 of 3 of this article. Click here to view the first page.

Scripting

The scripting language of choice in Unity is C#, a general-purpose, high-level language. C# is widely used for multiple applications, including software development. As such, you can find a lot of tutorials and documentation on how to use C# and the .NET ecosystem it resides in. Not only that, but there are many third-party .NET libraries you can use in your projects via NuGet for example. All of this makes C# an excellent choice for game development.

Godot’s main scripting language is GDScript, a high-level, object-oriented language which is similar to Python in terms of syntax and ease of use. It was developed and optimized specifically for Godot. Most Godot tutorials you’ll find will use GDScript, as it’s the most popular scripting language in the Godot community by far. Being a language that’s tied only to Godot has its downsides, as it’s not as widely used as C# or Python, so finding answers for specific problems can be more difficult.

With Godot 4, GDScript has been upgraded to version 2.0 and its syntax has had a major overhaul, which made it more powerful and versatile. This does have the unfortunate side effect of confusing beginners, as the bulk of learning materials out there use older versions of Godot, which are not compatible with the new syntax. Thankfully, the more popular Godot 4 becomes, the less of an issue this will become.

For a quick comparison, here’s a Hello World script in both C# and GDScript:

HelloWorld.cs

using UnityEngine;

public class HelloWorld : MonoBehaviour
{
    void Start()
    {
        Debug.Log("Hello, World!");
    }
}

hello_world.gd

extends Node

func _ready():
    print("Hello, World!")

As you can see, GDScript is more minimal than C# and needs less boilerplate code. Another huge difference is that GDScript is an interpreted language, which means you don’t have to wait for your scripts to compile before running your project. You can even inject code at runtime if you want. Being an interpreted language also means that it’s slower than C#, which is compiled to intermediate language (IL), but you won’t notice in the majority of cases.

If you don’t like the syntax of GDScript or simply prefer C#, I have some good news for you: Godot also supports C#! That’s right, while GDScript is way more popular, you can download the .NET build of Godot and use it with C#. You can even use your favorite IDE like VS Code or Visual Studio and use packages from NuGet. As a bonus, C# performs around 4x better than GDScript in cases where heavy calculations are involved.
Unfortunately, it’s not all good news, at least for now. There are a few limitations to consider when using Godot with C# at the moment:

  • Exporting projects to mobile platforms and the web isn’t supported until .NET 8 is released
  • It’s harder to find Godot tutorials that use C#
  • You lose a bit of performance as Godot’s engine needs to do expensive marshaling when talking to the .NET side

I recommend starting with GDScript to get a feel for Godot’s API before moving on to C#. To get a quick start, you can follow along with the Introduction to GDScript tutorial series.

Exporting Projects

What use is a game if it can’t be played? That’s where exporting, or building the project, comes in. Both Unity and Godot allow you to build your project to a variety of popular platforms, including:

  • Windows
  • macOS
  • Linux
  • WebGL
  • Android
  • iOS

Godot Exports

You can also export your project to game consoles like the PS5 , Switch , and Xbox One. Both game engines require that you register a developer account, purchase a developer license and get a devkit for the console you’re targeting. Depending on the console you might need a special build of Unity or Godot. Alternatively, there are also third-party companies that can help you port your game and get through the publishing process. If you’re interested in releasing your game on a console, I recommend giving the Console support in Godot page and this blog post by Juan Linietsky a read.

One platform that doesn’t have any export options in Godot (yet) is VisionOS. This might change in the future once the Apple Vision Pro is released to the public. If you’re set on developing for this platform, you’ll have to use Unity.

Converting Existing Projects

In this last section I want to address the proverbial elephant in the room: the question of whether you can convert an existing Unity project to Godot.
The straightforward answer to this query is a resounding no. Sadly, there isn’t a one-click solution for effortlessly porting a project made in Unity to Godot. At least not yet.

There are some tools out there that can at least convert Unity assets to Godot compatible ones, one of which is Unidot Importer. You can use Unidot Importer to convert .unitypackage files to a Godot-compatible format and convert some common Unity files like .unity and .mat. It’s not perfect, but it’s good to get started.

When it comes to code, you could use C# in Godot and try to reuse most of the logic. However, anything touching the Unity API, prefabs, components and physics will have to redone from scratch. Another option is to port your code entirely to GDScript, which is a tremendous undertaking, but it makes for good practice.

Where to Go From Here?

While I’ve covered a lot of ground in this article, this was just the tip of the iceberg. Both game engines have a lot to offer, so it’s hard to give a complete overview. You may find that some features you like in Unity are missing in Godot, or vice versa. The key is not to get frustrated, but to keep an open mind and experiment. With some patience and creativity, you’ll be able to create amazing projects with Godot in no time!

For more info about Godot, see our Introduction to Godot article. To learn about GDScript, see our Introduction to GDScript article series. Also keep an eye out for more tutorials on Godot here on Kodeco.com. If you have any questions, suggestions or comments, feel free to join the discussion below.

Contributors

Eric Van de Kerckhove

Author and Team Lead

Adriana Kutenko

Illustrator

Over 300 content creators. Join our team.