pause_mode = Node.PAUSE_MODE_PROCESS
if not $Panel.visible:
get_tree().paused = true
if Input.is_action_just_pressed("interact") and $Panel.visible:
get_tree().paused = false
This is the script for an object the player can interact with, which shows a panel with a TextureRect. (They're examining a poster on the wall.) I want the game to pause while the interaction is happening, and then unpause when the player presses Interact again. But right now, it's all happening in a single frame, so in-game it looks like nothing happens at all.
I think the best option might be a timer that triggers a boolean, but I figured I'd see if anyone had a better idea.