extends Area2D
func _ready():
$Panel.hide()
pause_mode = Node.PAUSE_MODE_PROCESS
func on_interact(player):
if not $Panel.visible:
$Panel.show()
get_tree().paused = true
func _input(event):
if Input.is_action_just_pressed("interact") and $Panel.visible:
$Panel.hide()
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.