+1 vote

I've been trying to add full controller support to my game, and I think that in order to navigate the menus I first need to set up the grab_focus() stuff but my game will black screen whenever I pause or die with this code enabled. Any tips? Following is from the death screen.

func _ready():
    $Menu/PlayButton.grab_focus() 
    if Input.is_action_pressed("ui_focus_next"):
         $Menu/ChangeSceneButton.grab_focus()
    elif $Menu/ChangeSceneButton.grab_focus() == true:
        $Menu/QuitButton.grab_focus()
in Engine by (47 points)

I'm pretty sure this is not the problem.
Please show the code that pauses the game.

Here it is

 onready var scene_tree: = get_tree()
onready var pause_overlay: ColorRect= get_node("PauseOverlay")
var paused: = false setget set_paused

func _ready():
    pause_overlay.visible = false



func _unhandled_input(event:InputEvent)-> void:
    if event.is_action_pressed("pause"):
        self.paused = not paused
        scene_tree.set_input_as_handled()



func set_paused(value: bool) -> void:
    paused = value
    scene_tree.paused = value
    pause_overlay.visible = value

is the pause_mode of your pause_overlay set to "process"?

Yup, it is set to process.

Can you share your project folder?

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.