Godot Version
Godot engine v 4.2.1
Question
having trouble with unpausing my game, this is the script for a textbox, its being sent a signal from the player character and on that signal I’m intending for it to display the text while pausing the game, awaiting the player to press space again, whereupon it’s supposed to hide the textbox and unpause the game.
it seems godot is reading and attempting to execute these commands, given that i get no error and a print command gets executed when placed before after and between the problem-commands in question.
extends RichTextLabel
signal pressed_space
func _ready():
process_mode = Node.PROCESS_MODE_ALWAYS #telling the nodes with this script to Always process no matter if game is paused or not
func _input(event):
if event.is_action_pressed("interact") :
pressed_space.emit()
func boxshow(boxtext):
set_visible(true)
set_text(boxtext)
get_tree().paused = true #makes the whole node tree endter a Paused state
func boxhide():
get_tree().paused = false ##THIS IS THE PROBLEM AREA
set_visible(false) ##THIS IS THE PROBLEM AREA
func _on_player_2d_textbox_signal(text_from_interactable):
boxshow(text_from_interactable)
await pressed_space
boxhide()