2
votes

This is probably an issue with my organization or the get_node statement, but I cannot find it myself. Here is my node layout:

◯ Node2D
   └─ ◯ ui
         └─ ◯ start_node
               ├─ ???? button_start ????????
               └─ ???? tutorial_popup 
                     ├─ ???? popup_background
                     ├─ ???? popup_no
                     └─ ???? popup_yes

(I tried, ok?)

Here is the script attached to button_start:

extends Button

onready var popup_bg =  get_node("../tutorial_popup/popup_background")
onready var popup_no =  get_node("../tutorial_popup/popup_no")
onready var popup_yes = get_node("../tutorial_popup/popup_yes")

func _ready():
    popup_bg.visible =  false
    popup_no.visible =  false
    popup_yes.visible = false

func _on_button_down():
    print("button \"" + self.name + "\" is down")
    
func _on_button_up():
    print("button \"" + self.name + "\" is up")

func _on_focus_entered():
    self.release_focus()

The exact error was as follows: Invalid set index 'visible' (on base 'null instance') with value of type 'bool' (regarding lines where popup_xyz.visible = false)

This was programmed in Godot 3.2.3. Thank you in advance.

EDIT: I had previously posted an answer simply stating that I had someone (I don't know how) gotten it to work. I have now deleted said answer, but will be leaving this question open for any future users with this problem.

Wow, that node tree made my day. - Oliort
Not reproduced on Godot 3.2.3. - Oliort
Don't know what to tell you, as I still don't know what the issue was or how I fixed it, hence how this question has no answers. - CATboardBETA