godot-mcp-tool

v0.3.0
godot-mcp-tool Checked 4 days ago Published 16 days ago

MCP server that connects Claude Code to the Godot editor

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

godot_status Godot status

Check the connection to Godot: which project is used, whether the Godot editor with the "Godot MCP Tool" plugin is connected, and which Godot executable and version are available. Call it first when another Godot tool reports a connection problem.

editor_launch Start the editor

Start the Godot editor for the project and wait until its "Godot MCP Tool" plugin connects, so the editor tools work. Use it when godot_status says the editor is not running. The editor keeps running after this session; it does nothing when the editor is already connected.

ParameterTypeDescription
headlessbooleanStart the editor without a window, as on a server; screenshots need a window. Default: with a window, or without one when the server runs with GODOT_MCP_HEADLESS=1.

project_create Create project

Create a new Godot 4 project for a game from scratch: project.godot with the name, the renderer, Jolt Physics, the window size and warnings for GDScript declarations without a static type, a main scene with a camera and a light, .gitignore, and the godot MCP addon installed with its plugin enabled. A server that started without a project works on the new one right away; start its editor with editor_launch.

ParameterTypeDescription
namestringThe name of the game. Default: the folder name in words, such as "Capsule Walk".
pathstringThe folder of the project, relative to the folder Claude Code runs in or absolute, such as "capsule-walk". It is created when missing and must be empty apart from hidden files and notes (.md). Default…
rendererstringforward_plus (default) for desktop 3D, mobile for phones and lighter 3D, gl_compatibility for the web and old hardware.
window_sizearrayThe window size [width, height] in pixels. Default: [1152, 648].

project_info Project overview

Summarize the Godot project: name, main scene, renderer, 3D physics engine, window size, autoloads, enabled plugins, global classes (class_name), the indentation style of .gd files and the top-level folders. Call it once when starting work on a project.

project_settings_get Read project settings

Read project settings (project.godot) by full name or by prefix. Pass names, prefix or both. Unknown names come back with similar existing names.

ParameterTypeDescription
namesarrayFull setting names, such as ["application/run/main_scene", "display/window/size/viewport_width"].
prefixstringRead every setting whose name starts with this, such as "display/window/".

project_settings_set Change project settings

Change project settings and save project.godot, for example the main scene (application/run/main_scene) or the window size. Each value is read back; the result lists what applied and the previous values, so the change can be reverted.

ParameterTypeDescription
values *objectSetting names mapped to new values, such as {"application/run/main_scene": "res://levels/arena.tscn"}. Values use the same formats as node properties.

user_data_get Read user data

Read user://, the folder where the game keeps saved games, settings and logs: without a path, every file with its size and the time it changed; with a file, its text. Use it to check what the game saved after game_run. Works without the editor. To clear saves, delete them with user_data_delete when unsafe tools are on.

ParameterTypeDescription
max_bytesintegerThe most bytes of a file to show.
pathstringA file or folder in the user data, such as "user://save.json" or "saves"; the user:// prefix may be left out. Default: the whole folder, listed.

editor_rescan Rescan project files

Make the editor pick up files changed outside it, such as scripts, scenes or assets written to disk and GDExtension libraries rebuilt by a native build: reload the rebuilt GDExtensions, rescan the project, import new assets and reload changed scripts, as the editor does when its window gets focus. Call it after writing files or rebuilding a GDExtension, before using them in scenes or validating scripts that use them.

editor_screenshot Editor screenshot

Render the 3D scene open in the editor from the editor camera or from given views, without the grid and gizmos; the editor camera stays where it is. Check placement and scale from more than one side, such as ["front", "top", "iso"]. With animation, render the poses of an animation at several times, such as the steps of a walk cycle. A UI or 2D scene, such as a HUD or a menu, renders as the game window would show it, at the window size of the project or at given sizes, such as 16:9 and 4:3 side by side. The lighting of 3D scenes is the editor preview, so check the final look with game_screensho…

ParameterTypeDescription
animationobjectRender the poses of an animation at given times without running the game, one labelled image per time in one picture, from the editor camera or from one given view. Method calls and sounds of the anim…
compare_tostringCompare the new picture with an earlier one, by the path that an earlier screenshot gave (the last 100 are kept) or as an image of the project, such as "res://screenshots/level.png": the result says h…
formatstringpng (default), or jpeg for a smaller file.
max_sizeintegerThe longest side of the image in pixels. Default: 1280.
sizesarrayFor a UI or 2D scene, the window sizes to render it at, such as [[1920, 1080], [1440, 1080]] for 16:9 and 4:3 in one labelled image; the layout follows the stretch mode and aspect of the project. Defa…
tolerancenumberWith compare_to, how much a color channel may change, from 0 to 1, before its pixel counts as changed. Default: 0.1.
viewsarrayRender the 3D scene from these angles instead of the editor camera, up to 6 in one labelled image: a preset "front" (from +Z), "back", "left" (from -X), "right", "top" or "iso", framed on the whole sc…

input_map_get Input actions

List the input actions of the project (Project Settings → Input Map) with their keys, mouse buttons and joypad events. The built-in ui_ actions are left out unless include_builtin is true.

ParameterTypeDescription
actionsarrayActions to show, such as ["move_forward", "jump"]. Default: every action of the project.
include_builtinbooleanAlso list the built-in ui_ actions, such as ui_accept.

input_map_set Change input actions

Create, change or remove input actions of the project and save project.godot. Give each action its full list of events; scripts then read it with Input.is_action_pressed("move_forward"). A game that is already running keeps its old actions until it starts again.

ParameterTypeDescription
actions *objectAction names mapped to their full list of events, such as {"move_forward": ["W", "Up"], "jump": ["Space", {"type": "joypad_button", "button": "a"}]}. Events: key names such as "W", "Space", "Up" or "C…

audio_buses_get Read audio buses

Read the audio bus layout of the project, as the Audio panel of the editor shows it: each bus in order with its volume in dB, the bus it sends to, mute, solo, bypass and its effects, and the file the layout is saved in. Players such as AudioStreamPlayer pick a bus by name with their "bus" property. Works without the editor. With in_game, listen to the running game: the level of each bus and the players that play, to tell a muted bus, a silent volume or a player that never starts from a sound that plays.

ParameterTypeDescription
in_gamebooleanListen to the running game instead: the loudest peak of each bus over a few physics frames, whether that is silence, and the players that are playing, with their bus and stream. Works with or without…
window_physics_framesintegerWith in_game, how long to listen, in physics frames (60 per second by default). Default: 30.

audio_buses_set Change audio buses

Add, change and remove buses of the audio bus layout of the project, as the Audio panel of the editor does, and save the layout file at once, so that the game starts with them: such as a Music and an Effects bus, each with its own volume, both sending to Master. Then pick the bus of each player with node_set_properties, such as {"bus": "Music"}; a player whose bus does not exist plays on Master.

ParameterTypeDescription
busesarrayBuses to add or change, in order; settings that are left out keep their value. Example: [{"name": "Music", "volume_db": -6}, {"name": "Effects"}].
removearrayBuses to remove by name. Master stays.

scene_create Create scene

Create a new scene file with a root node, save it and open it in the editor, so the scene and node tools work on it next. A 3D level usually has a "Node3D" root; pass a res://….tscn path as root_type to inherit from another scene.

ParameterTypeDescription
path *stringWhere to save the new scene, such as "res://levels/arena.tscn". The file must not exist yet; missing folders are created.
root_type *stringType of the root node: an engine class such as "Node3D", a class_name from the project, or a res://….tscn path to create a scene inherited from it.
root_namestringName of the root node. Default: the file name in PascalCase, so "arena.tscn" gets "Arena".

scene_open Open scene

Open a scene in the editor and make it the current scene, which the scene and node tools use when no scene is given. Tools that change a scene open it themselves, so this is mainly for choosing the default scene or showing a scene to the user.

ParameterTypeDescription
path *stringThe scene to open, such as "res://levels/arena.tscn", or "main" for the main scene of the project.

scene_save Save scene

Save scenes from the editor to disk: the current scene, a given scene, or all open scenes. Changes made with the scene and node tools stay unsaved until then, as in the editor. Save when a logical change is complete. Refuses with a conflict when a script changed on disk while the editor has unsaved changes to it.

ParameterTypeDescription
allbooleanSave every open scene instead of one.
scenestringThe scene to save, as a res:// path or "main" for the main scene of the project. Default: the scene currently open in the editor.

scene_get_tree Scene tree

Show the node tree of a scene as compact text: node names and types, attached scripts, instanced scenes and groups. Use it before changing a scene to learn the node paths that the node tools take. Reads the scene open in the editor by default, or any scene by its res:// path. The nodes inside an instanced scene are listed when its Editable Children is on, or for every instance with expand_instances.

ParameterTypeDescription
expand_instancesbooleanAlso include the nodes inside instanced scenes, such as "Enemy2/Mesh", which node_set_properties changes for that instance only. Default: only the instances themselves, and the nodes of instances whos…
max_depthintegerHow many levels below the root to show.
max_nodesintegerThe most nodes to list; hidden children are counted.
scenestringThe scene to read, as a res:// path or "main" for the main scene of the project; a scene that is not open is read from disk. Default: the scene currently open in the editor.

scene_batch_edit Edit scene in one step

Apply many scene changes in one call and as one Undo step: add, delete, change, move and duplicate nodes, set their groups, connect and disconnect signals. Later operations can use the nodes that earlier ones added or renamed. If any operation fails or any property is rejected, nothing is changed and the error names the operation; a value that the engine adjusts, such as a size raised to the minimum of a control, is kept and reported. Use it to build or rework a scene.

node_add Add node

Add a node to a scene: an engine class, a class_name from the project, or an instance of another scene, with its properties set at once. One Undo step in the editor; the scene stays unsaved until scene_save. The result reports which properties applied.

ParameterTypeDescription
type *stringWhat to add: an engine class such as "MeshInstance3D", a class_name from the project, or a scene to instance such as "res://props/crate.tscn".
indexintegerPosition among the children of the parent. Default: after the last child.
namestringName of the new node. Default: the type name; a taken name gets a number.
parentstringPath of the parent node relative to the scene root. Default: "." (the root).
propertiesobjectProperty names mapped to values, such as {"position": [0, 1, 0], "mesh": {"new": "BoxMesh", "size": [2, 1, 2]}}. Formats: numbers, booleans and text as JSON; vectors as [x, y, z] or "Vector3(0, 1, 0)"…
scenestringThe scene to change, as a res:// path or "main" for the main scene of the project; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

node_delete Delete nodes

Delete nodes and their children from a scene as one Undo step. If any path is not found, nothing is deleted. The scene root and nodes inside instanced scenes cannot be deleted here.

ParameterTypeDescription
paths *arrayPaths of the nodes to delete, relative to the scene root, such as ["Enemies/Goblin"]. Children go with their parent.
scenestringThe scene to change, as a res:// path or "main" for the main scene of the project; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

node_duplicate Duplicate node

Duplicate a node with its children, groups, scripts and signal connections, as one Undo step. The copy goes right after the original, or under parent; properties are set on the copy, such as {"position": [4, 0, 0]}.

ParameterTypeDescription
path *stringPath of the node relative to the scene root, such as "Player/Camera"; "." is the root itself.
namestringName of the copy. Default: the name of the original with a number, such as "Crate2".
parentstringPut the copy under this node instead of right after the original.
propertiesobjectProperty names mapped to values, such as {"position": [0, 1, 0], "mesh": {"new": "BoxMesh", "size": [2, 1, 2]}}. Formats: numbers, booleans and text as JSON; vectors as [x, y, z] or "Vector3(0, 1, 0)"…
scenestringThe scene to change, as a res:// path or "main" for the main scene of the project; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

node_reparent Move or rename node

Move a node to another parent, rename it, or change its place among its siblings, as one Undo step; its children move with it. 3D nodes keep their place in the world unless keep_global_transform is false. Node paths that pointed at the moved nodes, such as a RemoteTransform3D remote_path or an exported NodePath, are updated.

ParameterTypeDescription
path *stringPath of the node relative to the scene root, such as "Player/Camera"; "." is the root itself.
indexintegerThe new position among the children of the parent; 0 is the first.
keep_global_transformbooleanKeep a 3D node where it is in the world when its parent changes. Default: true.
namestringA new name for the node.
parentstringPath of the new parent, such as "Props"; "." is the scene root. Default: the current parent.
scenestringThe scene to change, as a res:// path or "main" for the main scene of the project; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

node_save_as_scene Save branch as scene

Save a node and its children as a scene file of their own and put an instance of that scene in their place, as Save Branch as Scene in the editor does: one Undo step, and the instance stays where the node was. Use it to turn something built in a level, such as an enemy, into a scene that other levels can instance with node_add. The new file is written at once; the changed scene stays unsaved until scene_save.

ParameterTypeDescription
file *stringThe new scene file, such as "res://enemies/enemy.tscn". It must not exist yet; missing folders are created.
path *stringPath of the node relative to the scene root, such as "Player/Camera"; "." is the root itself.
scenestringThe scene to change, as a res:// path or "main" for the main scene of the project; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

node_make_local Make instance local

Turn an instance of another scene into nodes of this scene, as Make Local in the editor does, as one Undo step: its nodes stop following changes to the instanced scene file and can then be moved, deleted and changed here like any other node. To change one instance but keep it linked to its scene, set properties of its nodes with node_set_properties instead.

ParameterTypeDescription
path *stringPath of the node relative to the scene root, such as "Player/Camera"; "." is the root itself.
scenestringThe scene to change, as a res:// path or "main" for the main scene of the project; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

node_find Find nodes

Find nodes in a scene by name, type, group or attached script; every given criterion must match. Returns their paths for the other node tools. The nodes inside an instanced scene are searched when its Editable Children is on, or in every instance with expand_instances.

ParameterTypeDescription
expand_instancesbooleanAlso include the nodes inside instanced scenes, such as "Enemy2/Mesh", which node_set_properties changes for that instance only. Default: only the instances themselves, and the nodes of instances whos…
groupstringA group the node belongs to, such as "enemies".
max_resultsintegerThe most nodes to list.
namestringPart of the node name, or a pattern with * and ?, such as "Enemy*". Case does not matter.
scenestringThe scene to read, as a res:// path or "main" for the main scene of the project; a scene that is not open is read from disk. Default: the scene currently open in the editor.
scriptstringThe attached script, as a res:// path or a file name such as "player.gd".
typestringA node class or class_name. Subclasses match too, so "Light3D" finds every light.

node_get_properties Node properties

Read the properties of a node, or of several nodes at once: those that differ from their defaults, or the ones named. Each value comes with its type, in Godot syntax; enums list their options, masks their layers. Use it to check nodes before or after changing them.

ParameterTypeDescription
include_defaultsbooleanWithout names, also list properties at their default values. The list gets long.
namesarrayProperties to read, such as ["position", "mesh"], or paths into a resource or a value, such as "mesh:size" or "position:y". Default: every property whose value differs from its default.
pathstringPath of the node relative to the scene root, such as "Player/Camera"; "." is the root itself.
pathsarrayRead several nodes at once instead of path, such as ["Player", "Enemies/Goblin"]: each comes back in its own block, and a node that is not found is reported among the others.
scenestringThe scene to read, as a res:// path or "main" for the main scene of the project; a scene that is not open is read from disk. Default: the scene currently open in the editor.

node_get_bounds Node bounds

Measure the box that a 3D node and its children take up in world coordinates: center, size and corners, from its meshes and CSG shapes, or from its collision shapes when it has none. For a Control or a 2D node, measure its rectangle in canvas pixels, from controls, sprites, polygons, lines and tile maps, or from 2D collision shapes; a control also says whether it fits the window of the project. Measures one node, or several at once. Use it to check placement and scale, such as whether a crate rests on the floor, a door is wide enough for the player or a health bar stays on screen.

ParameterTypeDescription
in_gamebooleanMeasure the nodes in the running game instead, where they may have moved. Needs a game started from the editor.
pathstringPath of the node relative to the scene root, such as "Level/Crate"; "." measures the whole scene. With in_game, a path in the running game, such as "Player".
pathsarrayMeasure several nodes at once instead of path, such as ["Crate", "Ramp", "Player"]; each comes back in its own block.
scenestringThe scene to read, as a res:// path or "main" for the main scene of the project; a scene that is not open is read from disk. Default: the scene currently open in the editor.

scene_raycast Cast a ray

Cast a ray through a 3D scene and return the first thing it hits: the position, the surface normal, the distance and the node, whether a collision shape or a visible mesh without collision. Straight down by default, to find the ground under a point; between two points to check a line of sight, such as whether an enemy sees the player. With in_game, cast in the running game.

ParameterTypeDescription
from *arrayWhere the ray starts, [x, y, z] in world coordinates, such as [0, 10, 0].
excludearrayNodes the ray passes through, with their children, such as the node being placed.
in_gamebooleanCast in the running game instead, against its current state. Needs a game started with game_run.
scenestringThe scene to cast in, as a res:// path; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.
toarrayWhere the ray ends. Default: 1000 m straight down from "from", to find the ground under a point.

node_snap_to_floor Place on the floor

Move 3D nodes straight down or up until each touches what is below it, a collision shape or a visible mesh, as one Undo step. A node stops where the first point of its collision shapes, or of its meshes when it has none, meets the surface, so nothing sinks into the ground and a node tilted like a slope lies flat on it. With align, each node is first turned so that its up axis follows the surface under it. Use it to put props on uneven ground, on slopes or on top of other objects.

ParameterTypeDescription
paths *arrayThe 3D nodes to place, such as ["Crate", "Props/Barrel"].
alignbooleanFirst turn each node so that its up axis follows the surface under it, such as a crate on a slope, then place it. Default: false, which keeps the rotation.
scenestringThe scene to change, as a res:// path or "main"; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

node_add_collision Add collision from a mesh

Give a MeshInstance3D a collision built from its mesh, as Mesh → Create Collision Shape in the editor does, as one Undo step, so that players and other bodies cannot pass through it. The result compares the size of the collision with the size of the mesh. CSG nodes take use_collision instead, and imported models their import settings.

ParameterTypeDescription
path *stringPath of the node relative to the scene root, such as "Player/Camera"; "." is the root itself.
shape *stringtrimesh follows every triangle and suits static level geometry; convex and simplified_convex wrap the mesh in one convex hull; multiple_convex splits it into up to 32 hulls for concave moving objects;…
axisstringThe axis of a capsule or a cylinder fitted to a mesh that is not one. Default: the longest side of the mesh.
placementstringstatic_body (default) adds a StaticBody3D child with the shapes, so that bodies cannot pass through the mesh; sibling adds CollisionShape3D nodes next to the mesh, for a mesh that is already part of a…
scenestringThe scene to change, as a res:// path or "main" for the main scene of the project; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

node_set_properties Set node properties

Set several properties of a node as one Undo step, including script (a res://….gd path) and resources (a res:// path, or {"new": "Class", …} to create one). Every value is read back: the result lists what applied, what was rejected and why, and what the engine changed, for example by clamping. A node inside an instanced scene, such as "Enemy2/Mesh", changes for that instance only: Editable Children of the instance is turned on, as in the editor, so that the change is saved with this scene.

ParameterTypeDescription
path *stringPath of the node relative to the scene root, such as "Player/Camera"; "." is the root itself.
properties *objectProperty names mapped to values, such as {"position": [0, 1, 0], "mesh": {"new": "BoxMesh", "size": [2, 1, 2]}}. Formats: numbers, booleans and text as JSON; vectors as [x, y, z] or "Vector3(0, 1, 0)"…
scenestringThe scene to change, as a res:// path or "main" for the main scene of the project; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

gridmap_get_cells Read GridMap cells

Read the cells of a GridMap: the blocks of its mesh library by name and number, how many cells use each, the box the cells fill and the cells themselves with their block and orientation, ordered by y, then z, then x. Use it to check a level built of blocks, whole or one box at a time. Works without the editor when "scene" is given.

ParameterTypeDescription
path *stringPath of the GridMap node relative to the scene root, such as "Level/Ground".
fromarrayOne corner of the box of cells to read, [x, y, z] in cells, such as [-4, 0, -4]. Give "to" with it. Default: every cell.
max_cellsintegerThe most cells to list; the counts cover every cell.
scenestringThe scene to read, as a res:// path or "main" for the main scene of the project; a scene that is not open is read from disk. Default: the scene currently open in the editor.
toarrayThe opposite corner of the box, included, such as [3, 0, 3].

gridmap_set_cells Paint GridMap cells

Put blocks of the mesh library of a GridMap on its cells, or erase them, as one Undo step: whole boxes of cells, such as a floor or a wall, and single cells, with blocks named as in the library. Cells are whole numbers on the grid, not meters: cell [x, y, z] sits at [x, y, z] times cell_size. Read the blocks and cells with gridmap_get_cells first.

ParameterTypeDescription
path *stringPath of the GridMap node relative to the scene root, such as "Level/Ground".
boxesarrayBoxes of cells to fill with one block each, in order, so that a later box paints over an earlier one: a floor from [-4, 0, -4] to [3, 0, 3] is 64 cells; a ring of walls is a box of walls with a floor…
cellsarraySingle cells to set after the boxes.
scenestringThe scene to change, as a res:// path or "main" for the main scene of the project; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

meshlibrary_create Make a MeshLibrary

Build the MeshLibrary of a GridMap from a scene of blocks, as the editor's Scene → Export As → MeshLibrary does: each MeshInstance3D with a mesh becomes an item named after the node, with its mesh and materials, the collision shapes of its StaticBody3D children and the navigation mesh of a NavigationRegion3D child. update: true changes an existing library and keeps the ids of its items, which the cells of a GridMap store. Then set mesh_library of the GridMap to the file and paint it with gridmap_set_cells. Save the scene of the blocks first; needs the editor.

ParameterTypeDescription
path *stringThe MeshLibrary file to write, such as "res://blocks/blocks.tres".
scene *stringThe saved scene of the blocks, such as "res://blocks/blocks.tscn": every MeshInstance3D in it with a mesh becomes a block named after the node, with the collision shapes of its StaticBody3D children a…
apply_transformsbooleanKeep the transform that each block has in the scene, such as a rotation, in its item. Default: false, as the Import from Scene of the editor does, so blocks laid out side by side in the scene each sit…
updatebooleanUpdate the library at path: blocks keep their ids by name, new blocks get new ids, and blocks the scene no longer has stay. Needed when the file exists, since the cells of a GridMap store the ids.

tilemap_get_cells Read TileMapLayer cells

Read the cells of a TileMapLayer: its TileSet with the tile size, the physics layers and each source with its texture, tiles and how many of them collide; how many cells use each tile, the rectangle the cells fill and the cells themselves, ordered by y, then x. Use it to check a 2D level of tiles, whole or one rectangle at a time. Works without the editor when "scene" is given.

ParameterTypeDescription
path *stringPath of the TileMapLayer node relative to the scene root, such as "Level/Ground".
fromarrayOne corner of the rectangle of cells to read, [x, y] in cells, such as [0, 0]. Give "to" with it. Default: every cell.
max_cellsintegerThe most cells to list; the counts cover every cell.
scenestringThe scene to read, as a res:// path or "main" for the main scene of the project; a scene that is not open is read from disk. Default: the scene currently open in the editor.
toarrayThe opposite corner of the rectangle, included, such as [29, 15].

tilemap_set_cells Paint TileMapLayer cells

Paint tiles of the TileSet of a TileMapLayer on its cells, or erase them, as one Undo step: whole rectangles, such as the ground or a wall, and single cells, each tile given by its [column, row] in the atlas of its source. Cells are whole numbers on the grid, not pixels: cell [x, y] sits at [x, y] times the tile size, and y grows downward. Read the tiles and the cells with tilemap_get_cells first.

ParameterTypeDescription
path *stringPath of the TileMapLayer node relative to the scene root, such as "Level/Ground".
cellsarraySingle cells to set after the rectangles.
rectsarrayRectangles of cells to fill with one tile each, in order, so that a later one paints over an earlier one: ground 30 tiles wide is {"from": [0, 10], "to": [29, 10], "atlas": [0, 0]}.
scenestringThe scene to change, as a res:// path or "main" for the main scene of the project; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

signal_list Signals and connections

List the signal connections saved in a scene, or every signal of one node with its arguments and connections. Use it before signal_connect to learn the signal names and the parameters a method needs.

ParameterTypeDescription
pathstringA node whose signals to list with their arguments and connections, such as "Door/Area". Default: every saved connection of the scene.
scenestringThe scene to read, as a res:// path or "main" for the main scene of the project; a scene that is not open is read from disk. Default: the scene currently open in the editor.

signal_connect Connect signal

Connect a signal of a node to a method of a node in the scene, saved with the scene like a connection made in the editor, as one Undo step. The method must already exist with matching parameters; if it does not, the error names the function to add to the script.

ParameterTypeDescription
from *stringPath of the node that emits the signal, such as "Button" or "Door/Area".
method *stringThe method to call, such as "_on_button_pressed".
signal *stringThe signal, such as "pressed" or "body_entered".
bindsarrayExtra values passed to the method after the signal arguments, such as ["door_a"].
deferredbooleanCall the method at the end of the frame instead of at once.
one_shotbooleanDisconnect after the first call.
scenestringThe scene to change, as a res:// path or "main" for the main scene of the project; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.
tostringPath of the node whose method is called. Default: "." (the scene root).

signal_disconnect Disconnect signal

Remove a saved signal connection from a scene, as one Undo step.

ParameterTypeDescription
from *stringPath of the node that emits the signal, such as "Button" or "Door/Area".
method *stringThe method to call, such as "_on_button_pressed".
signal *stringThe signal, such as "pressed" or "body_entered".
scenestringThe scene to change, as a res:// path or "main" for the main scene of the project; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.
tostringPath of the node whose method is called. Default: "." (the scene root).

resource_create Create resource

Create a resource file (.tres) with its properties set at once and save it: a material, physics material, environment, curve, or a resource of a class of the project. Use it for resources that several nodes or scenes share and assign it to them by its res:// path; a resource that only one node uses can be created right in the node property with {"new": "Class", …} instead. The result reports which properties applied.

ParameterTypeDescription
path *stringWhere to save the new resource, as a res:// path ending in .tres, such as "res://materials/ice.tres". Missing folders are created; an existing file is never replaced.
type *stringThe resource class: an engine class such as "StandardMaterial3D", "PhysicsMaterial", "Environment" or "Curve", or a class_name of the project that extends Resource.
propertiesobjectProperty names mapped to values, such as {"position": [0, 1, 0], "mesh": {"new": "BoxMesh", "size": [2, 1, 2]}}. Formats: numbers, booleans and text as JSON; vectors as [x, y, z] or "Vector3(0, 1, 0)"…

resource_get Read resource

Read a resource file such as a material, physics material or environment, or an imported one such as a texture: its type, the properties that differ from their defaults or the ones named, each with its type in Godot syntax, and the files it depends on; for a texture also its size in pixels. Scenes are read with scene_get_tree instead.

ParameterTypeDescription
path *stringThe resource file, as a res:// path such as "res://materials/ice.tres".
include_defaultsbooleanWithout names, also list properties at their default values. The list gets long.
namesarrayProperties to read, such as ["albedo_color", "roughness"], paths such as "next_pass:albedo_color", or methods without arguments whose names start with is_, get_, has_ or can_, such as "get_length()".…

resource_set_properties Set resource properties

Set several properties of a resource file such as a material or physics material as one Undo step and save the file, so the scenes that use it, the game and the tests see the change at once. Every value is read back: the result lists what applied, what was rejected and why, and what the engine changed. Imported files such as textures and models are changed through their import settings instead, with asset_import_settings_set.

ParameterTypeDescription
path *stringThe resource file, as a res:// path such as "res://materials/ice.tres".
properties *objectProperty names mapped to values, such as {"position": [0, 1, 0], "mesh": {"new": "BoxMesh", "size": [2, 1, 2]}}. Formats: numbers, booleans and text as JSON; vectors as [x, y, z] or "Vector3(0, 1, 0)"…

tileset_add_atlas Add a tile atlas

Cut a texture into tiles and add them to a TileSet as one atlas source, creating the TileSet file when it does not exist, and save it: every tile of the given size that is not empty, each with a full square collision when asked, so that bodies stand on it. This is how a 2D level of tiles starts: then give the TileSet to a TileMapLayer and paint its cells with tilemap_set_cells.

ParameterTypeDescription
path *stringThe TileSet file to create or add to, such as "res://tiles/ground.tres".
texture *stringThe image of the tiles, such as "res://tiles.png", as the editor imported it.
tile_size *arrayThe size of one tile in pixels, [width, height], such as [32, 32]. A new TileSet takes it as its tile_size.
collisionbooleanGive every tile a full square collision polygon on physics layer 0, added when the TileSet has none, so that bodies stand on the tiles. Default: false.
marginsarrayPixels to skip at the left and the top of the texture before the first tile. Default: [0, 0].
separationarrayPixels between neighboring tiles in the texture. Default: [0, 0].

resource_find_usages Find file usages

Find what uses a file, or the files of a folder, before moving, renaming or deleting it: the scenes and resources that refer to it, the project settings that point at it, such as the main scene or an autoload, and the lines of scripts and shaders that name its res:// path or its UID. Code is searched as text, so paths built while the game runs are not found, and code in res://addons/ is searched only for files of addons. For a folder, uses from inside the folder are left out.

ParameterTypeDescription
path *stringA file or folder of the project, as a res:// path such as "res://materials/ice.tres" or "res://materials".

filesystem_move Move or rename a file

Move or rename a file or folder of the project as the FileSystem dock does: its .import and .uid files go along, the scenes and resources that refer to it get the new path, open scenes follow, and project settings that point at it, such as the main scene or an autoload, are updated. References by UID keep working. Scripts and shaders that name the old res:// path are listed for you to change, and so are binary .scn and .res files that use it, which only the editor can rewrite. The move is not in the Undo history; move it back with filesystem_move. Refuses while a scene that it changes is open…

ParameterTypeDescription
from *stringThe file or folder to move, as a res:// path such as "res://materials/ice.tres".
to *stringThe new path, with the file or folder name, such as "res://surfaces/ice.tres", or "res://materials/frost.tres" to rename it. Missing folders are created; an existing file or folder is never replaced.

asset_import_settings_get Read import settings

Read how Godot imports an asset such as a glTF, FBX or .blend model, a texture or a sound: its importer options (nodes/root_scale, nodes/root_type, materials/extract, …), the settings stored for nodes of a model, and for a model the size, nodes and collision shapes of the imported scene. Check the size first: models often arrive in centimeters, such as a character 180 units tall, and need nodes/root_scale 0.01.

ParameterTypeDescription
path *stringThe imported file, as a res:// path such as "res://models/character.glb".

asset_import_settings_set Change import settings

Change the import settings of an asset and reimport it, so every scene that uses it gets the result. options change importer options, such as {"nodes/root_scale": 0.01} to turn centimeters into meters or {"nodes/root_type": "StaticBody3D"}; nodes give nodes of a model their own settings, such as collision with {"Body": {"generate/physics": true, "physics/shape_type": "Trimesh"}}. Primitive shapes (Box, Sphere, Cylinder, Capsule) are not fitted to the mesh: give primitive/size, primitive/radius and primitive/height in the model's own units, before root_scale, and primitive/position to move the…

ParameterTypeDescription
path *stringThe imported file, as a res:// path such as "res://models/character.glb".
nodesobjectSettings for nodes of a model, keyed by node path as asset_import_settings_get lists them, such as {"Body": {"generate/physics": true, "physics/shape_type": "Capsule", "primitive/radius": 25, "primiti…
optionsobjectImporter options by name, as asset_import_settings_get lists them, such as {"nodes/root_scale": 0.01, "materials/extract": "Extract Once", "materials/extract_path": "res://materials/"}.

navigation_bake Bake navigation mesh

Bake the navigation mesh of a NavigationRegion3D, or of every one in the scene, from the geometry under the region — floors and obstacles as meshes, CSG nodes or static collision shapes — as the editor's Bake NavigationMesh button does. One Undo step; the scene stays unsaved until scene_save, and the game uses the saved mesh. The result gives each region's polygon count and the area it covers, which is smaller than the floor by the agent radius; a region that gets no polygons comes with the reason, such as no geometry under it or an agent too large. Agent size and other bake settings are p…

ParameterTypeDescription
pathstringPath of the NavigationRegion3D relative to the scene root, such as "Navigation". Default: every NavigationRegion3D of the scene.
scenestringThe scene to bake in, as a res:// path; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

navigation_get_path Navigation path

Ask the navigation for the path from one point to another, as a NavigationAgent3D would get it: whether it reaches the target, its length and its points, and, when it stops short, where and how far from the target. It tells a level whose regions connect from one with a gap without running a chase. Reads the baked navigation meshes of the scene, which navigation_bake makes, or with in_game those of the running game.

ParameterTypeDescription
from *arrayWhere the path starts, [x, y, z] in world coordinates, such as the position of an enemy.
to *arrayWhere the path should end, such as the position of the player.
in_gamebooleanAsk the navigation of the running game instead, as its agents see it now. Needs a game started from the editor.
navigation_layersarrayThe navigation layers to walk on, by number or by the name the project gives them, as navigation_layers of a NavigationAgent3D. Default: [1], the layer of a new agent.
scenestringThe scene to ask, as a res:// path or "main"; a scene that is not open is read from disk. Default: the scene currently open in the editor.

voxelgi_bake Bake VoxelGI

Bake a VoxelGI, or every one in the scene, as the editor's Bake VoxelGI button does, so that it bounces light: it voxelizes the meshes and CSG shapes with GI mode Static inside its box and saves the data next to the scene as <scene>.<VoxelGI>_data.res, or into the file the VoxelGI already uses. A VoxelGI lights nothing until it is baked, and needs a bake again after the geometry inside changes. The link to the data is one Undo step, and the scene stays unsaved until scene_save. Needs the editor with a window and the Forward+ renderer. A LightmapGI or an OccluderInstance3D has no bake method fo…

ParameterTypeDescription
pathstringPath of the VoxelGI relative to the scene root, such as "Cave/VoxelGI". Default: every VoxelGI of the scene.
scenestringThe scene to bake in, as a res:// path; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

animation_get Read animations

Read the animations of an AnimationPlayer: each animation's length, loop mode and track count, or with name the tracks of one animation with their node paths, interpolation and keys. Track paths are relative to the player's root_node, the parent of the player by default.

ParameterTypeDescription
player *stringPath of the AnimationPlayer relative to the scene root, such as "AnimationPlayer" or "Door/AnimationPlayer".
namestringAn animation to show with its tracks and keys. Default: list every animation of the player.
scenestringThe scene, as a res:// path; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

animation_set Create or replace animation

Create or replace an animation of an AnimationPlayer from tracks, as one Undo step: a value track animates one property, such as {"path": "Door:position", "keys": [{"time": 0, "value": [0, 0, 0]}, {"time": 1, "value": [0, 3, 0]}]}, with a node path relative to the parent of the player and values in the formats of node_set_properties; a method track calls methods of a node at given times, such as footsteps: {"type": "method", "path": "Walker", "keys": [{"time": 0.25, "method": "_on_footstep"}]}; an audio track plays sounds through an audio player node: {"type": "audio", "path": "Walker/Footstep…

ParameterTypeDescription
name *stringName of the animation, such as "open"; "library/name" for an animation of another library than the default one.
player *stringPath of the AnimationPlayer relative to the scene root, such as "AnimationPlayer" or "Door/AnimationPlayer".
tracks *arrayOne track per animated property, per node whose methods are called and per audio player, each with all its keys.
lengthnumberLength in seconds. Default: the time of the last key.
loopstringnone (default) plays once, linear repeats, pingpong goes back and forth.
scenestringThe scene, as a res:// path; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

animation_delete Delete animation

Delete an animation of an AnimationPlayer as one Undo step.

ParameterTypeDescription
name *stringName of the animation, such as "open"; "library/name" for an animation of another library than the default one.
player *stringPath of the AnimationPlayer relative to the scene root, such as "AnimationPlayer" or "Door/AnimationPlayer".
scenestringThe scene, as a res:// path; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

animation_tree_get Read animation tree

Read an AnimationTree: the AnimationPlayer it takes animations from, whether it is active, and for a state machine its states, the transitions between them with their conditions and expressions, and the condition parameters that scripts set.

ParameterTypeDescription
tree *stringPath of the AnimationTree relative to the scene root, such as "AnimationTree" or "Player/AnimationTree".
scenestringThe scene, as a res:// path; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

animation_tree_set Set up animation state machine

Set up an AnimationTree as a state machine, as one Undo step: states that each play an animation of the AnimationPlayer or blend several by a parameter, such as walking and running by speed, and transitions between them, such as {"from": "Start", "to": "idle"} and {"from": "idle", "to": "walk", "condition": "moving", "xfade": 0.2}. It replaces the tree root; states or transitions the editor cannot use are rejected with the reason and the rest are kept. Scripts switch states by setting conditions, such as $AnimationTree.set("parameters/conditions/moving", true), or with travel("walk") on parame…

ParameterTypeDescription
states *arrayThe states, each playing one animation of the AnimationPlayer or blending several, such as [{"name": "idle", "animation": "idle"}, {"name": "move", "blend": [{"animation": "walk", "at": 2}, {"animatio…
tree *stringPath of the AnimationTree relative to the scene root, such as "AnimationTree" or "Player/AnimationTree".
playerstringPath of the AnimationPlayer whose animations the states play, relative to the scene root. Default: the one the tree already uses.
scenestringThe scene, as a res:// path; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.
transitionsarrayTransitions between the states. The machine begins at Start, so give one from Start to the first state. Default: none.

autoload_add Add autoload

Register a script or scene as an autoload: Godot creates it when the game starts and keeps it as a global node that every script reaches by its name, such as GameState.score. Use it for game-wide state, settings and managers. Saves project.godot at once.

ParameterTypeDescription
name *stringThe global name of the autoload that scripts use, such as "GameState".
path *stringThe script or scene to create when the game starts, as a res:// path, such as "res://autoload/game_state.gd". A script must extend Node.

autoload_remove Remove autoload

Remove an autoload from the project and save project.godot. Its script or scene file stays; scripts that use the autoload name fail until they are changed.

ParameterTypeDescription
name *stringThe global name of the autoload that scripts use, such as "GameState".

node_set_groups Set node groups

Add a node to groups or take it out of them, as one Undo step; the groups are saved with the scene. Scripts find the nodes of a group with get_tree().get_nodes_in_group("enemies"), and node_find finds them by group.

ParameterTypeDescription
path *stringPath of the node relative to the scene root, such as "Player/Camera"; "." is the root itself.
addarrayGroups to add the node to, such as ["enemies", "damageable"].
removearrayGroups to take the node out of.
scenestringThe scene to change, as a res:// path or "main" for the main scene of the project; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

editor_select Select in the editor

Select nodes in the scene tree of the editor, or a file in its FileSystem dock, to show the user what you are talking about; the inspector shows what is selected. Changes nothing in the project.

ParameterTypeDescription
filestringA file or folder to select in the FileSystem dock instead, such as "res://materials/ice.tres".
nodesarrayPaths of the nodes to select in the scene tree, such as ["Player", "Player/Camera"].
scenestringThe scene of the nodes, as a res:// path; the editor switches to it. Default: the scene open in the editor.

editor_undo Undo scene changes

Take back the last actions in a scene's Undo history, as Ctrl+Z in the editor does, and name them. Every change these tools make is one action named "MCP: …"; by default only those are taken back, and it stops at an action of the user. Redo them with editor_redo.

ParameterTypeDescription
countintegerHow many actions to step through, newest first. Default: 1.
include_user_actionsbooleanAlso step through actions that the user made in the editor. Default: false, so only the actions of these tools, named "MCP: …", are taken back or done again.
scenestringThe scene to change, as a res:// path or "main" for the main scene of the project; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

editor_redo Redo scene changes

Do again the actions that editor_undo or the user took back in a scene, as Ctrl+Shift+Z in the editor does, and name them. By default only actions of these tools, named "MCP: …", are done again.

ParameterTypeDescription
countintegerHow many actions to step through, newest first. Default: 1.
include_user_actionsbooleanAlso step through actions that the user made in the editor. Default: false, so only the actions of these tools, named "MCP: …", are taken back or done again.
scenestringThe scene to change, as a res:// path or "main" for the main scene of the project; it is opened in the editor if it is not open yet. Default: the scene currently open in the editor.

editor_get_state What the editor shows

Show what the user is looking at in the Godot editor: the scene on screen and the main screen (3D, 2D or Script), the nodes selected in the Scene dock, the files selected in the FileSystem dock, the script open in the script editor with the line of its caret and the selected text, and the open scenes. Use it when the user says "this node", "the selected object", "this script" or "here".

scene_close Close scene

Close a scene in the editor: the one named, or the one open now. A scene with unsaved changes stays open unless unsaved says to save them first or to discard them.

ParameterTypeDescription
scenestringThe scene to close, as a res:// path or "main" for the main scene of the project. Default: the scene currently open in the editor.
unsavedstringWhat to do with unsaved changes: "save" saves them first, "discard" drops them. Without it, a scene with unsaved changes stays open.

script_rename_symbol Rename symbol

Rename a function, signal, variable, constant, enum or class_name across the project with the editor's language server, which renames every use it can trace in the scripts; then also the method names of signal connections, the keys of method tracks, saved values and animated paths in scenes and resources that use the script, which a rename in code alone leaves broken. It lists the places that still name the old symbol, such as strings in call() or has_method(), to check by hand. Save open files first; needs the editor.

ParameterTypeDescription
new_name *stringThe new name, such as "apply_damage".
path *stringThe script that declares the symbol, as a res:// path, such as "res://enemy.gd".
symbol *stringThe function, signal, variable, constant, enum or class_name to rename, such as "take_damage".

script_find_references Find references

Find where a function, signal, variable, constant, enum or class_name is declared and used across the project, such as before changing the arguments of a function or removing it. Unlike a text search, it tells them apart from the uses of a symbol of the same name in another script, such as take_damage of Enemy from take_damage of Barrel. The editor's language server traces the uses in scripts, also through typed variables and class names; then come the signal connections, method track keys, saved values and animated properties of scenes and resources that use the script, which the language ser…

ParameterTypeDescription
path *stringThe script that declares the symbol, as a res:// path, such as "res://enemy.gd".
symbol *stringThe function, signal, variable, constant, enum or class_name to look for, such as "take_damage".

script_validate Check scripts

Check GDScript files for errors and warnings without running the game, as the Godot editor does: syntax, types, unknown identifiers, unused variables; and compile .gdshader files with Godot's shader compiler, which reports the first error of each shader with its line, also inside included files. Call it after writing or changing .gd or .gdshader files, before game_run. Scripts are checked with the editor's language server, or godot --check-only when the editor is not connected; shaders in the editor, or in Godot without a window.

ParameterTypeDescription
paths *arrayScripts, shaders or folders to check, as res:// paths or paths in the project, such as ["res://player/player.gd"], ["res://shaders/water.gdshader"] or ["res://player/"]. Folders are searched for .gd a…

plugin_set_enabled Enable plugin

Turn an editor plugin of res://addons on or off, as Project Settings → Plugins does: in the running editor, or in project.godot when no editor runs, so that the editor loads it when it starts. Plugins add tools to the editor, such as a test runner; their autoloads and custom node types come with them.

ParameterTypeDescription
plugin *stringThe plugin, by its folder in res://addons, such as "gut", or by its plugin.cfg, such as "res://addons/gut/plugin.cfg".
enabledbooleantrue (default) turns the plugin on, false turns it off.

test_install_framework Install test framework

Install a test framework into the project and enable its plugin, so that test_run can run the project's tests: GUT 9.7.1 (default) or gdUnit4 6.2.2, each pinned to the commit of its release and fetched from GitHub with git. It downloads code, so the user confirms every call.

ParameterTypeDescription
frameworkstringgut (default) installs GUT, gdunit4 installs gdUnit4.

test_run Run tests

Run the project's GUT or gdUnit4 tests in a separate Godot process and report the result: how many passed, failed and were skipped, each failure with its file, line and message, and test scripts that failed to load. Tests load scenes and resources from disk, so save changes first with scene_save. Works without the editor.

ParameterTypeDescription
frameworkstringThe test framework, needed only when the project has both GUT and gdUnit4 in addons/.
headlessbooleanRun without a window. Set false for tests that need rendering or real input events; a window opens while they run.
namestringRun only the tests whose names contain this text, such as "dash". GUT only: gdUnit4 runs whole test suites.
pathsarrayTest folders or scripts to run, as res:// paths, such as ["res://test/"] or ["res://test/test_player.gd"]. Default: res://test and res://tests, or the folders that .gutconfig.json names.
timeout_msintegerStop the run after this many milliseconds.

export_preset_add Add export preset

Add an export preset for a platform to export_presets.cfg, with the default options of that platform, so that export_project can export the game; mode "pack" of export_project needs no export templates. The editor reads presets when it starts, so its Export dialog shows a preset added while it runs only after a restart.

ParameterTypeDescription
platform *stringThe platform to export to, as Project → Export names it.
export_pathstringWhere the export goes, inside the project folder, such as "build/linux/capsule-walk.x86_64". Default: build/<platform>/ with the game name and the extension of the platform.
namestringThe name of the preset, which export_project takes. Default: the platform name.

export_project Export the game

Export the game with an export preset of the project, as Project → Export does, in a separate Godot process: a release or debug build, or only the game data as a .pck. The result lists the written files with their sizes and the warnings of the export. It writes only into a folder of its own inside the project, such as build/, which gets a .gdignore file so the editor does not import the exported files. Scenes and scripts are read from disk, so save changes first with scene_save. Release and debug builds need the export templates of the platform; when they are missing, the result says how to…

ParameterTypeDescription
modestring"release" or "debug" builds the game with the export templates of the platform; "pack" writes only the game data as a .pck or .zip file, which needs no export templates and runs with a Godot executabl…
outputstringWhere to write the export, with the file name, inside the project folder, such as "build/macos/game.zip"; the extension picks the format. Default: the export path of the preset, ending in .pck in mode…
presetstringThe export preset, by its name in Project → Export, such as "macOS" or "Windows Desktop". Default: the only preset of the project.
timeout_msintegerStop the export after this many milliseconds.

docs_class Class reference

Read the reference of the installed Godot version for a class: what it inherits, its properties, methods with their signatures, signals, enums and constants, each with a short summary; with member, the full description of one of them. Covers engine classes, built-in types such as Vector3, @GlobalScope functions such as lerp, and the class_name classes of the project. Use it before writing code with an API you are unsure of.

ParameterTypeDescription
name *stringA class such as "CharacterBody3D", a built-in type such as "Vector3", a class_name of the project, or "@GlobalScope"; "Class.member" works too.
memberstringOne property, method, signal, constant or enum of the class to show in full, such as "move_and_slide". Inherited members are found too.

game_run Run game

Run the game and return its first output: the main scene by default, the scene open in the editor, or a scene by path. Waits until the game is ready, then watches it for a second, or for duration_ms and stops it. Runs from the editor, which saves the open scenes and scripts first; without the editor, starts Godot as a separate process. Script errors do not pause the game unless break_on_error is set; they come with file, line and stack.

ParameterTypeDescription
argumentsarrayArguments for the game, which its scripts read with OS.get_cmdline_user_args(), such as ["--level=3"].
break_on_errorbooleanStop the game in the debugger at its first script error, as at a breakpoint, so that debug_state shows the stack and the variables there. Default: false, the game runs on. Needs the editor.
debug_drawarrayDraw debug shapes in the game, as the Debug menu of the editor does: "collisions" for collision shapes, "navigation" for navigation meshes, "paths" for Path3D curves, "avoidance" for avoidance radii.…
duration_msintegerKeep the game running this long after it is ready, then stop it. Without it, the game keeps running after the first second of output.
fixed_fpsintegerRun with a fixed frame rate, such as 60: every frame advances the game by exactly 1/fps seconds, so runs repeat exactly. Game time then no longer follows the clock, and without a window the game runs…
localestringRun the game in this locale, such as "de" or "pt_BR", to check its translations.
scenestringWhat to run: "main" (the main scene of the project), "current" (the scene open in the editor), or a res://….tscn path. Default: "main".
window_sizearraySize of the game window [width, height] in pixels, such as [1280, 720], to check the layout at another size.

game_stop Stop game

Stop the running game.

game_get_output Game output

Read what the game printed since the last call: messages, warnings and errors with file, line and stack, plus errors the editor reported, such as script parse errors. Pass levels: ["error"] for errors only, or from_start to read the current run again from its start.

ParameterTypeDescription
from_startbooleanRead the current run from its start instead of only what came after the last call.
levelsarrayOnly these levels, such as ["error"]. Default: all.
max_entriesintegerThe most entries to return; call again for the rest.

game_get_tree Running game tree

Show the node tree of the running game, including nodes it created while running, such as spawned enemies or bullets: names, types, scripts, instanced scenes and groups. With controls: true, list the visible buttons, labels and other controls with their rectangles and states instead. Needs a game started with game_run, with or without the editor.

ParameterTypeDescription
controlsbooleanList the visible controls instead: buttons, labels, text fields, sliders and bars, with their rectangles in game-view pixels, their text and whether they are disabled, pressed or focused, so that a me…
max_depthintegerHow many levels below the first node to show.
max_nodesintegerThe most nodes to list; hidden children are counted.
pathstringShow only this subtree: a path relative to the current scene, such as "Enemies", or "/root" for the whole tree with the autoloads. Default: the current scene.

game_get_properties Running game properties

Read properties of a node in the running game, or of several nodes in the same frame, like the remote inspector: positions, velocities, health, and getters such as is_on_floor(). Use it to check what the game is doing after game_run or game_wait. Needs a game started with game_run, with or without the editor.

ParameterTypeDescription
include_defaultsbooleanWithout names, also list properties at their default values. The list gets long.
namesarrayProperties to read, such as ["position", "velocity"], or paths such as "position:y" or "mesh:size". Methods without arguments whose names start with is_, get_, has_ or can_ can be read too, such as "i…
pathstringPath of the node in the running game: relative to the current scene, such as "Player"; "." for the scene root; or absolute, such as "/root/GameState" for an autoload.
pathsarrayRead several nodes at once instead of path, such as ["Player", "Enemy"]. They are read in the same frame, so their values belong together, such as the distance between them.

game_set_properties Set running game properties

Change properties of a node in the running game to try something out, such as moving the player or raising its speed, including variables of its script without @export, such as a score; a setter of the variable runs. The change lasts until the game stops; scene files stay as they are. Every value is read back. Needs a game started with game_run, with or without the editor.

ParameterTypeDescription
path *stringPath of the node in the running game: relative to the current scene, such as "Player"; "." for the scene root; or absolute, such as "/root/GameState" for an autoload.
properties *objectProperty names mapped to values, such as {"position": [0, 1, 0], "mesh": {"new": "BoxMesh", "size": [2, 1, 2]}}. Formats: numbers, booleans and text as JSON; vectors as [x, y, z] or "Vector3(0, 1, 0)"…

game_wait Wait in the game

Wait in the running game until a condition holds on a node, such as "is_on_floor()" on Player, until a node emits a signal, such as "died", or for a number of physics frames, frames or milliseconds. Pass exactly one of condition, signal, physics_frames, frames or ms. While game_pause holds the game, game_wait plays it until then and pauses it again on that frame, such as at the top of a jump with "velocity.y <= 0". Needs a game started with game_run, with or without the editor.

ParameterTypeDescription
conditionstringWait until this Godot expression is true on the node, such as "is_on_floor()" or "position.y < 0.1". It is checked after every physics frame.
framesintegerInstead of a condition, wait this many rendered frames.
msintegerInstead of a condition, wait this many milliseconds.
nodestringThe node the condition is evaluated on, or that emits the signal, such as "Player". Default: the current scene root.
physics_framesintegerInstead of a condition, wait this many physics frames (60 per second by default).
signalstringInstead of a condition, wait until the node emits this signal, such as "died" or "landed", and return its arguments.
timeout_msintegerHow long to wait for the condition or the signal before giving up. Default: 10 seconds.

game_input Play input into the game

Play input into the running game step by step: hold input actions, keys, gamepad buttons and sticks, move, click, drag and scroll the mouse, click a Control by its path, touch and drag fingers, type text, wait, and read nodes or take screenshots at exact moments, such as the height of a jump 10 physics frames after the press, which a later call would miss. A hold of N physics frames lasts exactly N frames of the game. While game_pause holds the game, the input plays it only for its holds and waits, then pauses it again. Also check the result with game_get_properties or a screenshot right after…

game_record_input Record the input of the player

Record what a person does in the running game, such as the walk and jump that make a bug happen, and get it back as steps of game_input: the input actions, keys, mouse, gamepad and touch input with the physics frames between them. Start it, let the person play, then stop it. Input that game_input itself plays is not recorded. Replayed from the same starting state with fixed_fps, the steps repeat the playthrough, so they can reproduce a bug or become a test. Needs a game started with game_run, with or without the editor.

ParameterTypeDescription
state *string"start" begins recording the input of the person who plays the running game; "stop" ends it and returns the steps.

game_screenshot Game screenshot

See the running game: a screenshot of its window with the UI, a strip of frames a given number of physics frames apart, or renders of its 3D world from other angles that leave the game camera alone. Returns the image and the path of its file. Pixel positions in a screenshot of the window are the positions that game_input clicks use. Needs a game started with game_run that has a window, with or without the editor.

ParameterTypeDescription
compare_tostringCompare the new picture with an earlier one, by the path that an earlier screenshot gave (the last 100 are kept) or as an image of the project, such as "res://screenshots/level.png": the result says h…
every_physics_framesintegerPhysics frames between the screenshots of frames. Default: 5.
formatstringpng (default), or jpeg for a smaller file.
framesintegerInstead of one moment, take this many screenshots of the game window, every_physics_frames apart, as one labelled image, to see motion such as a jump, an animation or a camera move. While game_pause h…
max_sizeintegerThe longest side of the image in pixels. Default: 1280.
tolerancenumberWith compare_to, how much a color channel may change, from 0 to 1, before its pixel counts as changed. Default: 0.1.
viewsarrayRender the 3D scene from these angles instead of the game window, up to 6 in one labelled image: a preset "front" (from +Z), "back", "left" (from -X), "right", "top" or "iso", framed on the whole scen…

game_pause Pause or resume the game

Pause the running game so that nothing moves, or resume it with paused: false. While it is paused, game_get_properties, game_screenshot and node_get_bounds read a frozen moment; game_step advances it by exact physics frames, and game_input and game_wait play it only for their holds and waits, then pause it again. Input sent while it is paused reaches the game in the next frame it plays. Nodes that the game sets to always process keep running. Needs a game started with game_run, with or without the editor.

ParameterTypeDescription
pausedbooleanfalse resumes a paused game.

game_step Step the game

Advance the paused game by exactly the given number of physics frames and keep it paused, to check what happens frame by frame, such as the height of a jump after 10 frames. Input sent while the game is paused reaches it in the first of these frames. A running game is paused after the frames. Needs a game started with game_run, with or without the editor.

ParameterTypeDescription
physics_framesintegerHow many physics frames to advance the game by (60 per second by default).

game_performance Game performance

Measure how the running game performs over a number of frames: frame time and FPS, time spent in process and physics code, draw calls and primitives, memory, counts of objects and nodes with orphan nodes (a sign of leaks), the load of 3D physics, the custom monitors the game adds with Performance.add_custom_monitor(), and in a game started from the editor the script functions that took the most time, with their files and lines. Needs a game started with game_run, with or without the editor.

ParameterTypeDescription
framesintegerHow many frames to measure.

debug_breakpoints Set breakpoints

Add or remove breakpoints in GDScript files, or list them. The game stops at a breakpoint when its code reaches that line while it runs from the editor (game_run), and debug_state then shows the stack and the variables there. They are the editor's own breakpoints, so the user sees them in the script editor; clear removes all of them, also those the user set. A breakpoint on an empty line or a comment never stops the game.

ParameterTypeDescription
addarrayBreakpoints to add, each "res://path.gd:line" with the line counted from 1, such as ["res://player/player.gd:42"].
clearbooleanRemove every breakpoint of the project first, also those the user set in the script editor.
removearrayBreakpoints to remove, written the same way.

debug_state Debugger state

Show where the game stopped in the debugger and why — a breakpoint, a step or an error — with the stack of function calls, the code around the line, and the local variables and members of a stack frame; with expression, also the value of a GDScript expression in that frame. With wait_ms it first waits for the game to stop, such as after game_input made the player do what reaches the breakpoint. While the game is stopped, game_get_properties still reads nodes, but game_wait, game_input and screenshots need debug_continue first.

ParameterTypeDescription
expressionstringA GDScript expression to evaluate in that frame, with its locals and members, such as "health - amount" or "get_node('Camera').position".
frameintegerThe stack frame whose code and variables to show: 0 is the line where the game stopped, 1 the function that called it, and so on.
wait_msintegerWhen the game is not stopped, wait this long for it to stop at a breakpoint, such as after game_input made the player jump. Default: 0, answer at once.

debug_continue Continue or step

Resume the game stopped in the debugger, until the next breakpoint, or by one line of code at a time. After a step the result shows the new line and its variables.

ParameterTypeDescription
actionstring"continue" runs the game until the next breakpoint; "step_over" runs the current line and stops at the next one; "step_into" also stops inside the functions that the line calls; "step_out" runs to the…