This Godot Engine tutorial explains how to create enums, compare enum values, get enum items and their names and how to format them. What are enums? Enum is short for “enumeration”. Enums are often used for selecting something from a list, where every item is mutually exclusive. Some examples: Enums are created like this: You […]
Godot
Godot Engine: How to fix materials with broken dependencies in .escn files exported from Blender
Using the .escn exporter for Blender (wiki page, download) allows you to easily reuse materials for multiple meshes in Godot. However, when you move or rename materials that are referenced by an .escn file (or a scene that contains an .escn file), the link to the material breaks and you see an error similar to […]
Godot Engine – Rotating a character with transform.basis.slerp
rotation_degrees, transform.basis and quaternions If you want to rotate a character towards a point, there are three popular methods you can use: modifying the character’s rotation_degrees.y value, changing the transform.basis or using quaternions. This tutorial will show you how the transform.basis approach works. The transform.basis property of any Spatial node (or nodes that inherit from […]
Godot Engine – How to get the class name of a custom class
If you have ever created custom classes by using class_name MyCustomClass in one of your scripts you might have noticed that these classes don’t return their custom class name when you use get_class() or is_class() on them. This tutorial will show you how to fix this. Let’s say you have a Player.gd script that inherits […]
How to export Tilesets from Blender to Godot
This tutorial is also available as a Guide on Steam. This tutorial will teach you how to prepare tilesets in Blender for export to Godot, how to use the .escn exporter for Blender and how to configure the tileset in Godot in a way that allows easy updating if your meshes change later on. Our […]
Godot Engine – How to remap a range of numbers
The explanation of range remapping in this article is universally applicable to every use case where value remapping is required. Towards the end of this article we’ll take a look at how to implement the formula as a function in the Godot game engine. If you are just here to understand how range remapping works […]
Godot Engine – How to create references to nodes
This tutorial explains how to create exported variables that reference nodes and how to combine this with static typing. Why using $ or get_node() is problematic To get a reference to a node in your node tree, you can use the $ sign followed by the node’s path. In a setup like on the next […]
Godot Engine – Raycast shotgun tutorial
This quick tutorial shows you how to use multiple raycasts in the same physics frame in the Godot Engine. This is useful for raycast (also called hitscan) weapons like shotguns that fire multiple pellets at the same time. Here’s the problem: by default, this doesn’t work in Godot and only the last of multiple raycast […]