godot 4.4
My problem is that when i press the menu button the game freezes and this error appears
Invalid assignment of property or key ‘pause’ with value of type ‘bool’ on a base object of type ‘SceneTree’
and i dunno how to solve it
code for pause menu
extends Node
@onready var panel_pausa: Panel = $Panel_Pausa
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
@warning_ignore("unused_parameter")
func _process(delta: float) -> void:
var esc_pressed = Input.is_action_just_pressed("pause")
if (esc_pressed == true ):
get_tree().paused = true
panel_pausa.show()
func _on_resumir_pressed() -> void:
panel_pausa.hide()
get_tree().paused = false
func _on_menu_pressed() -> void:
get_tree().pause = false
get_tree().change_scene_to_file("res://scenes/main_menu.tscn")