How to disable and enable a node in Godot 4: process_mode
Set node.process_mode = Node.PROCESS_MODE_DISABLED to stop its _process, _physics_process and input callbacks, together with its children's, and node.hide() to stop drawing it. Set PROCESS_MODE_INHERIT and show() to turn it back on. Godot 3's pause_mode is gone: Node.PAUSE_MODE_STOP fails to parse with Cannot find member "PAUSE_MODE_STOP" in base "Node".
AppImage, x86_64. Ubuntu 22.04, Debian 12, Fedora 39 or newer.
Intel or AMD Chromebook, with Linux turned on.
What Godot is checking
Godot 4 merged pause_mode into process_mode. PROCESS_MODE_DISABLED stops a node's processing and input whether or not the game is paused; PROCESS_MODE_INHERIT, the default, follows the parent.
Processing and drawing are separate. A disabled node still draws, and a hidden node still processes, so turning a node fully off is both.
Collision is separate again: a disabled body keeps colliding. Set its CollisionShape2D's disabled, with set_deferred() inside a physics callback, or remove it from the tree.
More on this: Parent node is busy setting up children, `add_child()` failed in Godot 4
Reproduce it
A Godot 3 pause mode, in a Godot 4 project.
extends Node
func _ready():
var enemy := Node2D.new()
enemy.pause_mode = Node.PAUSE_MODE_STOP
What Godot 4.7.2 prints
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org
SCRIPT ERROR: Parse Error: Cannot find member "PAUSE_MODE_STOP" in base "Node".
at: GDScript::reload (res://answers/how-to-disable-a-node-in-godot-4/repro.gd:5)
ERROR: Failed to load script "res://answers/how-to-disable-a-node-in-godot-4/repro.gd" with error "Parse error".
at: load (modules/gdscript/gdscript_resource_format.cpp:46)Fix it
Disable a counter node for ten frames, then enable it, and count how often it processed.
extends Node
class Counter extends Node:
var frames := 0
func _process(_delta: float) -> void:
frames += 1
func _ready() -> void:
var counter := Counter.new()
add_child(counter)
counter.process_mode = Node.PROCESS_MODE_DISABLED
for i in 10:
await get_tree().process_frame
print("while disabled: ", counter.frames)
counter.process_mode = Node.PROCESS_MODE_INHERIT
for i in 10:
await get_tree().process_frame
print("after enabling: ", counter.frames)
What the fixed script prints
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org
while disabled: 0
after enabling: 10Run this fix with your agent
Flockbay is the Godot editor with an AI agent built in. Paste this into Flockbay's chat, or into Claude Code or Codex connected to Flockbay over MCP: the agent finds the cause in your project, applies the fix, runs the game headless and reads Godot's output to check it.
More on this: How to set the window size in Godot 4: get_window().size
How to disable and enable a node in Godot 4: process_mode Set node.process_mode = Node.PROCESS_MODE_DISABLED to stop its _process, _physics_process and input callbacks, together with its children's, and node.hide() to stop drawing it. Set PROCESS_MODE_INHERIT and show() to turn it back on. Godot 3's pause_mode is gone: Node.PAUSE_MODE_STOP fails to parse with Cannot find member "PAUSE_MODE_STOP" in base "Node". Where this calls for a change in my Godot 4 project, make it, then run the game headless and check Godot's output for errors.Verified on Godot 4.7.2
Both scripts on this page were run headless on Godot 4.7.2 (4.7.2.stable.mono.official.ed1daf0bf) on 18 October 2026, and the output above is what Godot printed, unedited.
Where the check lives in Godot's source: gdscript_analyzer.cpp line 4122, the message, Node.process_mode in the class reference.
Questions
- What about set_process(false)?
- It stops _process() on that node alone, not its children or its physics and input callbacks. process_mode covers all of them and the subtree.
- How do I keep a pause menu running while the game is paused?
- Set the menu's process_mode to PROCESS_MODE_WHEN_PAUSED (or ALWAYS) and pause with get_tree().paused = true.
Flockbay's agent reads Godot's debugger output and fixes errors like this one in your project, on the official Godot.
Download Flockbay free