Problem Statement

We need to check whether Godot pauses at breakpoints. However, Godot does not provide a direct API for this.

The Tricky Way

If the program pauses at a breakpoint, the engine’s timer also pauses and we can check the delta time inside a _process function.

If now_tick - last_tick > PAUSE_THRESHOLD, this may be because the program has paused at breakpoints.

The DebugHelper class:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# DebugHelper.gd
extends Node


var last_pause_duration: float = 0.0


var _last_ticks_time: float = 0.0


const PAUSE_THRESHOLD := 1.0


func _ready() -> void:
	process_mode = Node.PROCESS_MODE_ALWAYS
	_last_ticks_time = Time.get_ticks_msec() / 1000.0


func _process(_delta: float) -> void:
	var tick_now := Time.get_ticks_msec() / 1000.0

	var tick_diff := tick_now - _last_ticks_time

	# Possible
	if tick_diff > PAUSE_THRESHOLD:
		last_pause_duration = tick_diff
		print("[DebugHelper] Detected possible debug pause:", last_pause_duration, "seconds")
		# Emit events if you need

	_last_ticks_time = tick_now

It could be an AutoLoad script. Alternatively, you can use signals or your custom event system to notify other systems when it detects potential debug pauses.