Ok, I just make a test project and it works fine. My test project looks like this:
Spatial
Spatial --> Script A
Camera
MeshInstance ---> Script to make it move up and down
Script A:
extends Spatial
var paused = false
func _ready():
pause_mode = Node.PAUSE_MODE_PROCESS
func _process(_delta):
if Input.is_action_pressed("escape") and paused == false:
paused = true
get_tree().paused = true
elif Input.is_action_pressed("escape") and paused == true:
get_tree().paused = false
paused = false
Pressing escape pauses and unpauses. Putting it in func _input
would be a bit better btw.
Good luck!