Blog/Software Development

How to Create Your First 3D Game in Godot 4.3: A Beginner-Friendly Tutorial

Laptop screen displaying one of the steps to create a 3D game in Godot

Godot is a free, open-source game engine that enables you to build high quality 2D and 3D games. It includes a code editor, an animation editor, a tilemap editor, a shader editor, a debugger, a profiler, and more. Godot supports GDScript, which is a Godot specific integrated programming language with a lightweight syntax, as well as C# and C/C++. Godot also supports external programs like Blender and VSCode (and more).

If you want to create 2D or 3D games for free, without having to pay any additional fees later, Godot is the right tool for you.

In this blog post, we will show you how to choose the best language for your needs, how to install and set up a Godot project, and how to make a simple 3D game using GDScript.

Why choose Godot for game development?

You may already know popular game engines like Unity or Unreal Engine. 

Based on data provided by SteamDB, Unity is the most used game engine on Steam, with a total of 47,065 games published. The second most used game engine is Unreal Engine, with a total of 13,521 games published. 

Godot isn't as popular as these engines. In fact, it ranks number 7 with a total of 1,600 games published on Steam.

With Unity and Unreal Engine  ranking so high, you may ask yourself, “Why should I choose Godot? After all, it's the 7th most used game engine on Steam.”

Here are the reasons why Godot is a great choice, despite its ranking:

Godot is completely free. Forever.

Godot is completely free, so you won't have to worry about any additional fees or charges. Despite their popularity, Unity and Unreal Engine have some downsides:

  • Unity. Once you've earned over $100K, you have to subscribe to Unity Pro, which costs $2040.00 per year per seat. In addition to this, once you've reached 1 million lifetime installs and you have earned $1 million in gross revenue in the last 12 months, you have to pay a 2.5% royalty of your monthly gross revenue.On top of all that, you also have to pay for the initial engagement fee, which is a small fee for each download your game gets.
  • Unreal Engine. Once you've reached lifetime gross revenue of $1 million, you will be subject to a 5% royalty. Though 5% may not sound like a lot, in reality it can end up costing you thousands of dollars a month.

Godot is an open-source platform.

Godot Engine is open source under the MIT license, which means: 

  • You are free to use Godot Engine for any purpose.
  • You can study how Godot Engine works and change it.
  • You can distribute unmodified and changed versions of Godot Engine, even commercially and under a different license (including proprietary licenses).
  • You are free to license your games how you best see fit, and will be their sole copyright owner(s).

Godot is beginner friendly.

Godot has an intuitive and easy-to-navigate interface, making it accessible for beginners. It features GDScript, which is a Python-like scripting language that is considered to be easy to learn.

Which programming language should you use in Godot?

Godot supports three programming languages: GDScript, C# and C++. You may think that you have a difficult task of deciding which language would be the best for you, but this is not the case with Godot. You can mix and match the languages as much as you like. One script can be written in GDScript, while the other in C#. All you have to do is to decide which language best suits your needs.

However, it is not recommended to use C++ in Godot if you are a beginner and have no prior experience with this language. Let’s look at each of the options.

Option 1: GDscript

If you are new to game development or programming overall, go for GDscript, as it is the most well-documented language for game development using Godot. Choosing GDscript will also enable you to familiarize yourself with the Godot game engine the fastest.

Though Godot is the slowest language of the three, it still offers good performance.

Option 2: C#

C# offers better performance than GDScript, but isn't as easy to learn as GDScript. Not only that, but there’s not as much documentation or tutorials for game development in Godot using C# as there are for using GDScript, so that could make your game development with C# a little harder.

But once again, if you want  optimal performance for your game, C# is a better option than GDScript.

Option 3: C++

C++ is the programming language you want if you're going for the best performance and efficiency possible. If you are proficient in C++ already, feel free to use it, otherwise, it is advised to stick to C# or GDScript.

You may be interested in: How to Create a Simple MacOS Cocoa Application using C# and Xamarin.mac

Installing Godot 4.0

To install Godot, go to https://godotengine.org/download. You will see two versions of Godot Engine:

Download page for Godot 4 for macOS

Godot Engine

This version supports only GDScript.The installation process is very simple:

  1. Go to the Godot Engine download page, and click on the “Godot Engine” button to download Godot.
  2. Once Godot has finished downloading, unzip the folder and proceed with the installation.

Congratulations, you've successfully installed the Godot Engine!

Godot Engine - .NET

This version supports C# and GDScript. This is the version we recommend downloading. The installation process is also fairly simple, but it has a few extra steps:

  1. Head over to Download. Net and download the latest stable version of .NET setup.
  2. Once the .NET setup has been downloaded, open it and follow the instructions to install it.
  3. When you've successfully installed the .NET framework, you're ready to download Godot. 
  4. Go to theGodot Engine download page, and click on “Godot Engine - .NET”.
  5. Once Godot Engine .NET has successfully downloaded, unzip the folder and proceed with the installation.

Congratulations, you've successfully installed Godot Engine - .NET! Now comes the fun part—setting up and building our game.

Setting up a project

To set up your first project, follow these steps:

  1. Launch Godot Engine.
  2. Click the “+ Create New Project ” button on the top left. 
  3. Now choose your project path. You can choose your project path based on your own preference. The “Documents” folder or “Desktop” folder could be a good choice.
  4. Rename your project to something else, for example, “FirstProject”.
  5. Next, make sure "Create Folder" is enabled. Click the  “Create a Folder” button to create a new folder that is named after your project. This folder ensures that your project files are stored only in this specific folder. For example, if you choose your project path as “Desktop” but don't create a folder, your desktop will become cluttered with random project files.
  6. Click “Create & Edit”. After clicking the “Create & Edit” button, Godot should open your project automatically.

Creating a scene

Once you’ve created the project, , you will see the “Scene” section on the left side. This section contains multiple “Create a Root Node” options. 

Depending on the game you want to create, you can choose between two types of scenes: 2D or 3D. In this tutorial, we will be creating a 3D game, so we’ll select the“3D Scene” option.

After selecting the “3D Scene” option, a new node will appear on the left side and you will see a transform gizmo appear in the scene (the spherical object with red, blue and green axes in the middle of the screen). You can learn more about nodes and scenes in this Godot documentation

Rename the new node to “Game” and save the scene. The scene will be saved to the project folder with the .tscn extension.

Creating a player

To create a player, you will need to create a new scene. To do this, click the “Add New Scene” button which is located on the top.

In the new scene, select the “Other” root node,search for “CharacterBody3D” node, select the node and click “Create”.

You can learn more about “CharacterBody3D” properties, methods, etc. in this Godot documentation

Adding a mesh to your character

You may have noticed that the new scene is empty, as there is nothing displayed here. To fix this, we need to add a “MeshInstance3D” node to the “CharacterBody3D” node.

In short, the “MeshInstance3D” node allows you to add a resource to the current scenario. For example, you can add a 3D character model to your “CharacterBody3D” node. 

Right now, we aren't going to add a custom 3D character, instead we will add an existing mesh - “CapsuleMesh”. The reason we are going for the “CapsuleMesh” specifically, is because the physics for the capsule behave the most like a character would.

To add a mesh to your character, follow these steps:

  1. Click on the “CharacterBody3D” node.
  2. Add a child node by clicking the “+” button. 
  3. Search for “MeshInstance3D”.
  4. Select “MeshInstance3D”.
  5. Click “Create”.
  6. Select the “Inspector” menu on the right side. With the “MeshInstance3D” node selected, click the “Mesh <empty>” field.
  7. Click “New CapsuleMesh”.

Now we've added a mesh to our character. But this is just the mesh - if we were to launch the game right now, the character wouldn't interact with any objects as it has no collision shape. Basically, the character would be a ghost. You can learn more about MeshInstance3D here.

Adding a collision shape to your character

To fix this “ghost” character, we need to add the “CollisionShape3D” node and add a collision shape to our character. Normally, we want the collision shape to be about the same shape as our character, but since we used the capsule mesh, we can also use the preset capsule collision shape.

To add a collision shape to your character, follow these steps:

  1. Click on the “CharacterBody3D” node.
  2. Add a child node by clicking the “+” button. 
  3. Search for “CollisionShape3D”.
  4. Select “CollisionShape3D”.
  5. Click “Create”.
  6. Click the “Inspector” menu on the right side. With the “CollisionShape3D” node selected, click the “Shape <empty>” field.
  7. Click “New CapsuleShape3D”.

Now that our character has a collision shape ,it will be able to interact with the environment. As of now, we have no environment, but we will create one later on. You can learn more about 3D collision shapes here

Adding a camera

The very last thing we need to do in the player scene, is to add a camera. The “Camera3D” is a node that displays what is visible in its current location. You can learn more about the “Camera3D” node here

For this project, we want the camera to follow our character, so we are going to attach the camera node to our character. You are free to choose whatever camera placement you want, but for this project we are going with a third person camera.

Keep in mind that the player is facing the Z direction, which means that the camera should also face the Z direction (when you add a camera node, it faces the Z axis by default). 

This means that to make a third person camera, we need to move the camera further back in the Z axis.

To add a camera, follow these steps:

  1. Click the “CharacterBody3D” node.
  2. Add a child node by clicking on the “+” button. 
  3. Search for “Camera3D” and select it.
  4. Click “Create”.
  5. Zoom out so you can move the camera further back.
  6. Adjust the camera location and rotation to your preference. 
  7. To check what the camera will look like, click the “Preview” button on the top-left.

Finally, we've created our character. Now we need to rename our character and save the scene.

To rename your character, right click on the “CharacterBody3D” node and click rename. We're going to rename our character to “Player”. 

To save the scene, right click the scene tab and click “Save Scene”.

This is what it should look like:

Screen showing the results of the steps taken to create a player in Godot

Creating an environment

This project is going to be really simple, so we are going to create a simple world. Just the world environment, a floor and some objects.

To get started with world creation, go back to the “Game” scene.

Adding a sky

The first thing we're going to do is create a sky. To do this, we need to add the “WorldEnvironment” node as a child node to our “Game” node and edit some properties. 

Follow these steps to add the “WorldEnvironment” node:

  1. Select the “Game” node.
  2. Add a child node by clicking on the “+” button.
  3. Search for the “WorldEnvironment” node and select it.
  4. Click “Create”.

As you can see, the world turned dark. This is because we still need to change some properties for the “WorldEnvironment” node.

This is how to add a custom sky:

  1. Select the “WorldEnvironment” node.
  2. Click the “Environment <empty>” button in the “WorldEnvironment” properties located on the right side, and choose “New Environment”.
  3. The “<empty>” field will update to “Environment”, click on it.
  4. Choose the Background Mode as “Sky”.
  5. Choose the sky as “New Sky”.
  6. Choose the sky material as “NewProceduralSkyMaterial”.

This is how to change the color of the sky:

  1. Following the previous steps, open the “Sky Material” menu.
  2. Open “ProcedualSkyMaterial”.
  3. Here you will see the “Sky” and “Ground” sections.
  4. Open the “Sky/Ground” section and change the “Top/Bottom” and “Horizon Color” to your own preference. You can also keep it to the default colors.

For this project, in the “WorldEnvironment” node, we're only going to change the sky. You can learn more about the “WorldEnvironment” node here

Adding a floor

Now we have the sky color we want, but we have nowhere for the player to stand on. To fix this, we will add a floor.

To add a floor, follow these steps:

  1. Select the “Game” node.
  2. Add a child node by clicking on the “+” button.
  3. Search for the “StaticBody3D” node and select it.
  4. Add the “MeshInstance3D” node and the “CollisionShape3D” node as child nodes to the “StaticBody3D” node.

We've added all the necessary nodes for our floor, now we need to adjust their properties.

First, we are going to add a floor mesh, which means that we'll be adjusting properties on the “MeshInstance3D” node.

To add a floor mesh, follow these steps:

  1. Select the “MeshInstance3D” node.
  2. In the properties menu on the right, change the mesh from “<empty>” to “New PlaneMesh”.
  3. Now click on the mesh in the “Properties” menu to open extra properties.
  4. Change the size to 20 by 20.

Now we have the floor mesh, but we still need a collision shape so the player can walk on the floor and not just fall through it. To do this, we will be adjusting the properties in the “CollisionShape3D” node.

To add a collision shape to the floor, follow these steps:

  1. Select the “CollisionShape3D” node.
  2. In the properties menu on the right, change the shape from “<empty>” to “New BoxShape3D”.
  3. Now click the “BoxShape” button in the properties menu to open extra properties.
  4. Change the size to X20, Y1, Z20.

Right now, the collision shape is above our floor, so we need to change its Y position so it matches the height of the floor.

  1. In the “CollisionShape3D” node properties, find the “Transform” section and open it.
  2. Change the Y position to -0.5.

Lastly, we can rename the “StaticBody3D” to “Floor”. You've renamed before, so you should know how to do it, but in case you forgot - right click the node you want to rename and select “Rename”.

Adding player to your game scene 

Now, when we have added a floor, we are ready to add a player to our scene.

On the bottom left, you can see the game resources Here you will find all the scenes you have, including the player scene (player.tscn).

Here's how to add a player to our game scene:

  1. Find “player.tscn” in the game resources.
  2. Drag and drop the player into your scene.
  3. Select the “Player” node.
  4. In the “Properties” menu look for “Transform” and open it for extra properties.
  5. Reset the “Position” properties by clicking the “Reset” button.
  6. Change the Y axis value to 1.1. This will ensure that our player is slightly above the ground and won't clip into the ground once we start our game.

Adding light to your game scene

If we were to start our game now, everything would be dark and we would have no shadows. To fix this, we have to add the “DirectionalLight3D” node and adjust some properties.

Here's how to do it:

  1. Select the “Game” node.
  2. Add a child node by clicking the “+” button.
  3. Search for “DirectionalLight3D” and select it.
  4. Once the “Light” node has appeared in the scene, move and rotate it based on your own preference.
  5. In the properties menu on the right, you will see the “Shadow” section. Open it and enable “Shadows”. 

This is what it should look like:

Screen showing the results of the steps taken to create an environment in Godot

More information about the “DirectionalLight3D” node can be found here

Programming your game

We have successfully created a player and an environment. Obviously, everything we did is just visual, we haven't added any scripts.

We're going to create a very simple game. We are going to color the tile the player is standing on in blue. Once every tile is blue, the color will change to something different. This way we have a simple, endless game.

Adding player movement

First, we're going to add player movement to our game. To do this, we will use a custom template, but we'll have to change it up a little.

First of all, we're going to have to add some custom input maps.

Here's how to do it:

  1. Go to “Project Settings”.
  2. Choose the “Input Map” tab.
  3. In the “Add New Action” field, input the name of your action and click “Add”.
  4. After adding the action, click the “+” button that appears next to it.
  5. On your keyboard, click on the button you want to assign to this action.
  6. Click “OK”.

These are the actions we're going to assign to our game:

  1. “Forward” - W
  2. “Backward” - S
  3. “Left” - A
  4. “Right” - D
  5. “Jump” - Space

Make sure the first letter is uppercase.

This is what it should look like:

Screen showing the actions assigned to the game in Godot

More information about the input map can be found here

While you're still in the “Project Settings” menu, you can change the game to run in maximized screen:

  1. In the project settings, go to the “General” tab.
  2. Look for the “Window” button under the “Display” section and click on it.
  3. Change the “Mode” field to “Maximized”.

Now we are ready to add the movement script to our player. This blog isn't about teaching you how to code in GDScript, it's more about how to use the Godot Engine, so we won't go into great detail about the coding process itself. The script will be included below, and it will be commented, so you can copy the code and attach it.

GDScript

extends CharacterBody3D

const SPEED = 5.0
const JUMP_VELOCITY = 4.5

# Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity = ProjectSettings.get_setting("physics/3d/default_gravity")

func _physics_process(delta):
	# Add the gravity.
	if not is_on_floor():
		velocity.y -= gravity * delta

	# Handle jump.
	if Input.is_action_just_pressed("Jump") and is_on_floor():
		velocity.y = JUMP_VELOCITY

	# Get the input direction and handle the movement/deceleration.
	var input_dir = Input.get_vector("Left", "Right", "Forward", "Backward")
	var direction = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
	if direction:
		velocity.x = direction.x * SPEED
		velocity.z = direction.z * SPEED
	else:
		velocity.x = move_toward(velocity.x, 0, SPEED)
		velocity.z = move_toward(velocity.z, 0, SPEED)

	move_and_slide()

Now follow these steps to add the movement script:

  1. Select the “Player” node.
  2. Click the “Attach Script” button.
  3. Make sure you're not using a template script.
  4. Click “Create”.
  5. Delete all existing code.
  6. Paste the code you copied above.
  7. Save the code by pressing Command + S (or Control + S on Windows) on your keyboard.
  8. You can go back to the “Scene” by clicking on the “3D” button on the very top.

Creating a tile library

As mentioned before, for the purpose of this tutorial, we will create a simple game.  Whenever the player steps on a tile, the color of the tile will change. To do this, we need tiles. We can create a tile library with three different color tiles like this:

  1. Create a new scene.
  2. As a root node, choose the “3D Scene” (also known as “Node3D”).
  3. Click the “Node3D”, and add a “MeshInstance3D” child node.
  4. For the mesh, choose “New BoxMesh”.
  5. Click “BoxMesh”.
  6. Change the size to X - 2, Y - 0.1, Z - 2.

Now we have a tile, but we still need to add a collision shape so the game knows when the player touches this tile.

To add a collision shape, follow these steps:

  1. Select the “MeshInstance3D” node and add the “StaticBody3D” child node.
  2. Select the “MeshInstance3D” node again.
  3. Click the “Mesh” button above the scene.
  4. In the “Mesh” menu, click “Create Single Convex Collision Sibling”. This is the fastest way to create a mesh to custom shapes.
  5. Drag the “CollisionShape3D” node to the “StaticBody3D” node.

To make the tiles change color when a player steps on them, we need three tiles of the same size. Each tile needs to be a different color. Basically, when a player steps on a tile of a certain color, the tile will be replaced by a different color tile.

To add color to your tile, follow these steps:

  1. Click on the “MeshInstance3D” node to display “Properties” on the right side.
  2. In the “Properties” menu, click the mesh to display additional properties.
  3. Look for “Material” and change it to “New StandardMaterial3D”.
  4. Click the “Material” to display additional properties.
  5. Open the “Albedo” section.
  6. Change the color to your preference.

It is recommended to rename nodes so you can recognize which nodes are which later on. We're going to rename the “MeshInstance3D” node to “TilePurple” and “Node3D” to “Library”.

Now we have our first tile set up. The code provided below is going to work only with three tiles in the library, so you need to add two additional tiles to the library. 

To do this, create a new “MeshInstance3D” node under the “Library” node and follow every step you did to create the first tile, making sure to set different colors for the additional two tiles. 

Since the colors we chose for the tiles in this tutorial are blue and green, we recommend that you stick to the same color choices to avoid confusion.

This is what it should look like after you've created all three tiles:

Screen displayed after creating a tile library with three different colored tiles

Now we need to save our scene so we don't lose our tiles.

After saving the scene with the tiles, we also need to export them as “MeshLibrary”. We can use the tiles for the “GridMap” node, which we are going to use to draw our floor.

To do this, follow these steps:

  1. Right click on your “Scene” tab and select “Save Scene”.
  2. Click “Save” in the new window that pops up.
  3. Now on the top-left, go to “Scene” -> “Export As” -> “Mesh Library”.
  4. Use the “.tres” format and name it as “library.tres”
  5. Click “Open”.
  6. You should now see the “library.tres” file in your resources folder on the bottom left.

Adding tiles with GridMap

Once we have created three different color tiles, we are ready to go back to the “Game” scene and add the “GridMap” node. 

Follow these steps to create the “GridMap” node, add a library to it and rename it:

  1. Click the “Game” node to select it and add the “GridMap” child node to it.
  2. Select the “GridMap” node to see its properties on the right side.
  3. Drag and drop the “library.tres” file to the “GridMap” “Mesh Library”.
  4. Rename “GridMap” to “Tiles”.

Once we have the library set up to our grid map, we are ready to create a 10x10 grid. There are multiple ways to do this:

  1. Select the “TilePurple” and place them one by one on your floor.
  2. Select an area and fill it with the “TilePurple” selected.

We're going to use the fastest approach, which is selecting an area and filling it.To do this, follow these steps:

  1. Make sure “TilePurple” is selected in your library.
  2. Select the “GridMap” node.
  3. Click on the Y axis to view everything from the top, as this way it will be easier to select an area.
  4. While holding shift, click and drag your mouse from one corner to another until you've selected the whole floor.
  5. Just above the scene, click the “Grid Map” button.
  6. In the new window, click “Fill Section”.

After adding the tiles, you will notice that they’re floating above the ground. 

To fix this, you need to adjust the Y axis by following these steps:

  1. Select the “GridMap” node.
  2. Click “Transform” to view more properties.
  3. Change the Y axis position to -1.

This is what it should look like:

Screen displayed after setting up the GridMap node

If you'd like to learn more about the “GridMap” node, you can read this Godot documentation

Changing tile color

We are now ready to add a script which will change the tiles when a player touches them.

We're going to attach the script to our “Game” node. Once again, we won't go into details about the script. In case you want to understand it better, it is well commented.

GDScript

extends Node3D

# The GridMap containing tiles
@onready var tiles_gridmap = $Tiles
# Reference to the Player node
@onready var player = $Player

# The ID for "TilePurple", "TileBlue", and "TileDefault" in the tiles.tres library
var TILE_BLUE = 1   # ID for "TileBlue"
var TILE_GREEN = 2  # ID for "TileGreen"
var TILE_PURPLE = 0 # ID for "TilePurple"

# Keeps track of the color transitions
var transition_to_third = false
var transition_to_default = false
var allow_second_again = false 

# Store the last known tile position of the player
var last_player_tile_pos = Vector3(-1, -1, -1)

# A cooldown to prevent rapid tile changes
var change_cooldown = 0.01  # Cooldown time in seconds
var time_since_last_change = 0.0

func _process(delta):
	# Update the cooldown timer
	time_since_last_change += delta
	
	# Get player's global position and convert it to the local gridmap coordinates
	var player_global_pos = player.global_transform.origin
	var gridmap_pos = tiles_gridmap.local_to_map(player_global_pos)
	
	# Convert gridmap_pos to a Vector3
	var gridmap_vector = Vector3(gridmap_pos.x, gridmap_pos.y, gridmap_pos.z)
	
	# Only proceed if the player is on a new tile and the cooldown has passed
	if gridmap_vector != last_player_tile_pos and time_since_last_change >= change_cooldown:
		
		# Reset the cooldown
		time_since_last_change = 0.0
		# Update the last known player position
		last_player_tile_pos = gridmap_vector
		# Get the current tile ID at this position
		var current_tile_id = tiles_gridmap.get_cell_item(gridmap_vector)
		
		# Prevent turning default tiles back to purple if we are in transition
		if transition_to_default:
			
			if current_tile_id == TILE_GREEN:
				
				tiles_gridmap.set_cell_item(gridmap_vector, TILE_PURPLE)
				
		elif transition_to_third and current_tile_id == TILE_BLUE:
			
			tiles_gridmap.set_cell_item(gridmap_vector, TILE_GREEN)
		elif allow_second_again and current_tile_id == TILE_PURPLE:
			
			tiles_gridmap.set_cell_item(gridmap_vector, TILE_BLUE)

		# After making changes, check if we should start a new transition phase
		_check_all_tiles()

# Checks if all tiles are colored in one color
func _check_all_tiles():
	var used_cells = tiles_gridmap.get_used_cells()
	var count_blue = 0
	var count_green = 0
	var count_purple = 0
	var total_tiles = used_cells.size()

	# Loop over all used cells in the GridMap to count blue, purple, green tiles
	for cell in used_cells:
		var tile_id = tiles_gridmap.get_cell_item(cell)
		if tile_id == TILE_BLUE:
			count_blue += 1
		elif tile_id == TILE_GREEN:
			count_green += 1
		elif tile_id == TILE_PURPLE:
			count_purple += 1

	# If all tiles are purple, start the transition to blue
	if count_blue == total_tiles and total_tiles > 0 and not transition_to_third:
		transition_to_third = true
		transition_to_default = false
		allow_second_again = false
		
	# If all tiles are blue, start the transition back to default
	elif count_green == total_tiles and total_tiles > 0 and not transition_to_default:
		transition_to_default = true
		transition_to_third = false
		allow_second_again = false
		
	# Once all tiles are default (white), allow purple again
	elif count_purple == total_tiles and total_tiles > 0 and not allow_second_again:
		allow_second_again = true
		transition_to_third = false
		transition_to_default = false

To add the script, follow these steps:

  1. Click the “Game” node.
  2. Click the “Attach Script” button.
  3. Click “Create”.
  4. Delete all existing code.
  5. Paste the code you copied above.
  6. Save the code by pressing Command + S (or Control + S on Windows) on your keyboard.

If you'd like to learn more about GDScript, click here

Running the game

Finally, we are ready to run our gameTo do so, follow these steps:

  1. Click the “Run Project” button on the top right.

When you first run your game, you will be asked to select a main scene.

  1. Click the “Select” button.
  2. Choose the “game.tscn” file.
  3. Click “Open”.

Congratulations, you've created your first game!

If you've followed every step correctly, you should see that once you've colored all of the tiles blue, the tiles will change their color to green. Once everything is green, the tiles are going to change their color to purple. And the cycle continues.

You may notice some issues with the game, such as the player being able to fall off our platform. This is where your newly learned information comes in—challenge yourself, create a wall so the player can't fall off the platform. 

Remember that game development is a long process that requires a lot of time and effort. Not only that, but to make progress, you need to practice and continue learning.

Key takeaways

In this blog post, we have demonstrated how to create a very simple 3D game using the Godot Engine and GDScript. 

By following our step-by-step guide, you’ve  learned how to work with multiple 3D nodes, which include 3D meshes and collision shapes, world environment, light, and GridMap. Additionally, you now know how to create new scenes, such as the player scene and library scene. Using this tutorial you will be able to use the project input map and create a player character that supports movement using keyboard input.

Do you need help building or testing your game? Contact us with your project details to learn more about how we can help you and your team.

QA engineer having a video call with 5-start rating graphic displayed above

Deliver a product made to impress

Build a product that stands out by implementing best software QA practices.

Get started today