This is a 2D Platformer game which features an NPC you can interact with. He opens up a shop screen when interacted with. The shop screen consists of five buttons. One of them is a Leave shop button, three are upgrades, and one is a continue on (Because choosing this will allow passage to progress).
My issue here is I need full controller support and for some reason I can't grab focus of the "Leave" button when the shop opens (that is, when I make the shop screen visible to the player).
The NPC is a KinematicBody 2D, and it has a child node that is a CanvasLayer, with the buttons being children of that. Here's my script :) any help would be very appreciated!
Here's some of the relevant script:
var in_area = false
var open = false
onready var anim = get_node("AnimationPlayer")
pausemode = PAUSEMODEPROCESS
$ShopScreen/Bubble.visible = false
if not open:
open = true
gettree().paused = true
# I NEED TO GRAB FOCUS HERE BUT ITS NOT WORKING