How to disable and enable a node in Godot 4: process_mode

By Eduardo Orellana · Updated

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.

Download for macOSDownload for Windows

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.

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: 10

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](https://github.com/godotengine/godot/blob/4.7.2-stable/modules/gdscript/gdscript_analyzer.cpp#L4122), [Node.process_mode in the class reference](https://github.com/godotengine/godot/blob/4.7.2-stable/doc/classes/Node.xml).

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.