Hello!
I have a scene created in Godot 2D, in which I have created also a CanvasLayer ( that contains a Control with a Container and buttons) . This Control script is not visible during the game.
After I finish beating the enemy I want to make visible my CanvasLayer/Control , while the main game is put on pause.
So, I beat the enemy:
I have a global variable that is put on true, then I acces funconWorld10_acces(). And this is the code of my control. The game is paused, ( which is what I wanted) , but when I click on my buttons nothing happens.
extends Control
func ready():
$MarginContainer/CenterContainer/VBoxContainer/Start.grabfocus()
func physicsprocess(delta):
if $MarginContainer/CenterContainer/VBoxContainer/Start.ishovered()== true:
$MarginContainer/CenterContainer/VBoxContainer/Start.grabfocus()
if $MarginContainer/CenterContainer/VBoxContainer/Quit.ishovered()== true:
$MarginContainer/CenterContainer/VBoxContainer/Quit.grabfocus()
func onWorld10acces():
gettree().paused= not get_tree().paused
visible = not visible
func onStartpressed():
gettree().paused= not gettree().paused
gettree().change_scene("res://StartMenu.tscn")
func onQuitpressed():
gettree().quit()
Do you know how I can resolve this?