Quick answer: GDScript resolved Y.x while parsing and found that the class, enum or constant Y has nothing called x. The usual reasons are a constant renamed in Godot 4 (Label.ALIGN_CENTER), an instance variable read through a class name, or a typo in an enum value. Fix the name, or reach the member through the thing that owns it: an instance, an autoload, or the right enum.

This is a parse error, so the script refuses to load and everything attached to it stops working until the line is fixed. The message names two things: the member Godot looked for and the base it looked in. Most of the work is noticing that the base is not what you thought it was: a class where you meant an object, an enum’s parent where you meant the enum, a Godot 3 name on a Godot 4 class. Below are the causes in order of how often they turn up, a table of renamed constants, the fix for each, and the form the same mistake takes at runtime, where the wording is different.

The exact error

The script editor underlines the member and shows the message at the bottom of the code view:

Cannot find member "ALIGN_CENTER" in base "Label".
Cannot find member "score" in base "GameState".

If you run the game anyway, the log shows the script failing to load:

SCRIPT ERROR: Parse Error: Cannot find member "ALIGN_CENTER" in base "Label".
          at: GDScript::reload (res://hud.gd:14)
ERROR: Failed to load script "res://hud.gd" with error "Parse error".

The first quoted name is what you wrote after the dot. The second is what Godot decided the expression before the dot is. An engine class or a script with class_name is shown by name, a script loaded with preload() and no class_name is shown by its res:// path, and an enum is shown by its own qualified name. For built-in value types such as Vector2 and Color, some versions say “constant” or “property” where this message says “member”; the meaning is the same.

When Godot raises it, and when it stays quiet

The analyser only raises this error when the base is something whose contents are fully known while parsing: a class used by name, an enum, or a constant. Label.ALIGN_CENTER, Player.State.IDEL and Weapons.MAX_AMMO are all checked this way, because a class cannot grow new constants while the game runs.

A variable that holds an object is treated differently, even when it has a type. In var body: Node2D, body.health is not an error: Node2D has no health, but the node stored in the variable might be a subclass that does. Godot marks the line as unsafe (the line number loses its green tint) and checks at runtime. That case is covered in its own section, because the fix and the message are different.

What causes it

  1. A Godot 3 constant on a class that still exists. Label.ALIGN_CENTER, Control.PRESET_WIDE, Node.PAUSE_MODE_PROCESS, RigidBody2D.MODE_KINEMATIC. The class survived the move to Godot 4 and the constant did not.
  2. An instance variable read through a class name. A script declares class_name GameState and var score, and another script writes GameState.score as if the class were a singleton. score belongs to each instance, so the class itself has no such member.
  3. A typo in your own enum value or constant. State.IDEL, Player.MAX_SPED. Names are case-sensitive, so State.Idle does not match IDLE.
  4. An enum value read from the wrong level. With enum State { IDLE, RUN } in player.gd, the value is Player.State.IDLE. Player.IDLE only works for an unnamed enum.
  5. The script you point at does not define it. The constant moved to another file, the preload() path names a different script than you think, or a local constant with the same name as a global class is hiding that class.

Work out which one you have

  1. Read the base in the message before anything else. If it is a class name and you meant a node or an autoload, you have cause 2. If it is a res:// path you did not expect, a const X = preload(...) in this script or a parent script is what X resolves to.
  2. Ctrl+click the name before the dot. An engine class opens its class reference page, where the Enumerations and Constants sections list every valid name. One of your own classes opens its script.
  3. Delete the member, type the dot again and look at the autocompletion list. It shows exactly what the analyser knows about that base.
  4. If the project came from Godot 3, check the table below before searching further.

Fix 1: replace Godot 3 constants

These are renames where the class kept its name, which is why the error names the class as the base:

Godot 3Godot 4
Label.ALIGN_LEFT / ALIGN_CENTER / ALIGN_RIGHTHORIZONTAL_ALIGNMENT_LEFT / _CENTER / _RIGHT (global, no class prefix)
Label.VALIGN_TOP / VALIGN_CENTER / VALIGN_BOTTOMVERTICAL_ALIGNMENT_TOP / _CENTER / _BOTTOM (global)
Control.PRESET_WIDEControl.PRESET_FULL_RECT
Node.PAUSE_MODE_PROCESSNode.PROCESS_MODE_ALWAYS
Node.PAUSE_MODE_STOPNode.PROCESS_MODE_PAUSABLE
Object.CONNECT_ONESHOTObject.CONNECT_ONE_SHOT
RigidBody2D.MODE_STATIC / MODE_KINEMATICThe mode property is gone. Set freeze = true and freeze_mode to RigidBody2D.FREEZE_MODE_STATIC or FREEZE_MODE_KINEMATIC
Color.white, Color.red (lowercase)Color.WHITE, Color.RED (a built-in type, so the message may say “constant”)

The properties these constants were assigned to changed as well. A Godot 3 label alignment becomes:

# Godot 3
$Title.align = Label.ALIGN_CENTER

# Godot 4
$Title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER

Two neighbouring groups produce a different message. Constants that were global in Godot 3, such as the mouse button family (BUTTON_LEFT, BUTTON_RIGHT, BUTTON_MIDDLE, BUTTON_WHEEL_UP, BUTTON_WHEEL_DOWN, now MOUSE_BUTTON_LEFT and so on), have no base, so Godot reports them as an identifier that is not declared. And when the class itself was renamed, as with File.READ (now FileAccess.READ), the complaint is about the class name; the class table is in the “Could not find type” guide.

Fix 2: stop reading instance data through a class

This is the broken pattern:

# game_state.gd
class_name GameState
extends Node

var score := 0
# hud.gd
extends Control

func _process(_delta: float) -> void:
    $Score.text = str(GameState.score)   # Cannot find member "score" in base "GameState".

GameState here is the class, a blueprint with no data of its own. There are three ways out, depending on what you meant.

You wanted one shared object. Register the script under Project > Project Settings > Globals > Autoload (a top-level Autoload tab in Godot 4.2 and earlier) and use the autoload’s name. Remove the class_name line or give the autoload a different name, because a class and an autoload with the same name collide and Godot reports Class "GameState" hides an autoload singleton.

You wanted data that belongs to the class. Make it static (Godot 4.1 and later):

class_name GameState
extends Node

static var score := 0

You wanted one particular node. Get a reference to it and read the variable from that:

@onready var game_state: GameState = get_node("/root/Main/GameState")

func _process(_delta: float) -> void:
    $Score.text = str(game_state.score)

Calling a non-static function through a class name is the same mistake and gets its own message. A function name that is missing from the base altogether is covered in the “Function not found in base” guide.

Fix 3: use the full enum path and the exact name

# player.gd
class_name Player
extends CharacterBody2D

enum State { IDLE, RUN, JUMP }
const MAX_SPEED := 300.0
var state := State.IDLE
# enemy.gd
func can_ambush(player: Player) -> bool:
    # player.state == Player.IDLE         error: IDLE lives inside State
    # player.state == Player.State.IDEL   error: typo
    return player.state == Player.State.IDLE

A named enum is a member of the class and its values are members of the enum, so the path has three parts from outside the script. Inside player.gd you still write State.IDLE; a bare IDLE only exists when the enum has no name. If you find yourself typing long paths often, give the enum its own script with a class_name so that every file refers to it the same way.

Fix 4: point at the script that defines the member

When the base in the message is a path or a class that should have the member, open that script and search for the name. Common findings: the constant was moved to a shared file during a refactor and one caller was missed, the preload points at a similarly named file in another folder, or the member sits in an inner class and needs the inner class name in the path.

const Balance = preload("res://data/balance.gd")

var fire_rate := Balance.FIRE_RATE    # FIRE_RATE must be a const or enum in balance.gd

Constants and enums are inherited, so a member defined in a parent script is found through the child. They are not found sideways: a constant in weapon.gd is not visible through enemy.gd unless one extends the other.

The same mistake at runtime

Reach a missing member through a variable instead of a class name and the script compiles. The failure moves to the moment the line runs:

func _on_body_entered(body: Node2D) -> void:
    body.health -= 10

When a wall without a health variable enters the area, a game run from the editor or exported with debug stops with this on Godot 4.3 and later:

Invalid access to property or key 'health' on a base object of type 'StaticBody2D'.

Godot 4.0 to 4.2 word it as Invalid get index 'health' (on base: 'StaticBody2D'). The same applies to a script’s constants read through a reference typed as Node: it works while the node really carries that script and fails with this message when it does not.

To handle it properly, cast and check:

func _on_body_entered(body: Node2D) -> void:
    var enemy := body as Enemy
    if enemy:
        enemy.health -= 10

as returns null when the object is not an Enemy, so the wall is skipped. To have the editor flag unchecked accesses, open Project > Project Settings > Debug > GDScript (turn on Advanced Settings if the section is hidden) and raise Unsafe Property Access from Ignore to Warn or Error.

How to confirm the fix

Save the script and watch the error line disappear from the script editor; a parse error is gone when the file has no red marker and the scene runs. Then use Search > Find in Files for the old name across the project, because a renamed constant is rarely used in one place and every other script that uses it fails separately, only when it is loaded. For a ported project, run each scene at least once: scripts are parsed when first loaded, so a broken one in a rarely visited menu stays hidden until someone opens it.

What reaches you from players

The parser error is an editor-time problem, and Bugnet has no part in fixing it. What can reach players is a script exported without ever being loaded: it fails to parse on their machine and the failure is written to the engine’s log. Bugnet’s Godot SDK builds its automatic error capture on that log file, so with File Logging enabled (it is off by default on mobile exports) the failure can arrive as a report with platform, OS and game version, stacked by title. The runtime form is less dependable. Release export templates leave out much of GDScript’s runtime checking, so do not count on a log line there. Keep the as guard shown above and file the unexpected branch yourself with report_error(message, stack). More on what an exported game can see in capturing script errors at runtime.

Frequently asked questions

What does Cannot find member in base mean in Godot 4?

While parsing the script, GDScript looked up the name after the dot inside the class, enum or constant before the dot and found nothing with that name. It is a parse error, so the whole script fails to load until the name is corrected.

Why does Label.ALIGN_CENTER give Cannot find member in Godot 4?

Godot 4 removed the alignment constants from Label. Use the global constant HORIZONTAL_ALIGNMENT_CENTER and assign it to the horizontal_alignment property, which replaced align. Vertical alignment uses VERTICAL_ALIGNMENT_CENTER and the vertical_alignment property.

Why can I not access a variable through my class_name?

A class name refers to the class, not to an object made from it, and ordinary variables exist only on objects. Read the variable from an instance or an autoload, or declare it with static var in Godot 4.1 or later so it belongs to the class.

Why is there no error when I access a missing property on a typed variable?

A variable typed as a class may hold a subclass that has the property, so Godot defers the check to runtime and marks the line as unsafe. Enable the Unsafe Property Access warning in the GDScript debug settings to see these lines while editing.

How do I access an enum from another script in Godot 4?

Use the owning class, then the enum name, then the value, for example Player.State.IDLE where Player is the class_name of the script. Values of a named enum are not members of the class itself, so Player.IDLE fails.

Read the base in the message first. If it names a class where you expected an object, the member name is probably fine and the thing before the dot is wrong.