Skip to main content

Cant Can't find sibling node, keeps giving "null instance"

ImI'm trying to set it up so that there are three buttons but only one can be toggled at a time. So when one button gets toggled it makes sure that the other two are not toggled.

The code is trying to set the toggeledtoggled status however since it cantcan't find the node imI'm at a loss.

var vec = Vector2(0,1000)
var ori = Vector2(0,0)
func _ready():
    pass

func _on_Ally1_Button_toggled(button_pressed):
    if button_pressed:
        set_position(ori)
        $Player_Button.set_pressed(false)
    else:
        set_position(vec)

This is what the tree looks like.

enter image description here

The Player_Ally1_uiPlayer_Ally1_ui is trying to access Player_ButtonPlayer_Button but as stated it cantcan't seem to find it and just returns null.

Any help is greatly appreciated, thank you in advance.

Cant find sibling node, keeps giving "null instance"

Im trying to set it up so that there are three buttons but only one can be toggled at a time. So when one button gets toggled it makes sure that the other two are not toggled.

The code is trying to set the toggeled status however since it cant find the node im at a loss.

var vec = Vector2(0,1000)
var ori = Vector2(0,0)
func _ready():
    pass

func _on_Ally1_Button_toggled(button_pressed):
    if button_pressed:
        set_position(ori)
        $Player_Button.set_pressed(false)
    else:
        set_position(vec)

This is what the tree looks like.

enter image description here

The Player_Ally1_ui is trying to access Player_Button but as stated it cant seem to find it and just returns null.

Any help is greatly appreciated, thank you in advance.

Can't find sibling node, keeps giving "null instance"

I'm trying to set it up so that there are three buttons but only one can be toggled at a time. So when one button gets toggled it makes sure that the other two are not toggled.

The code is trying to set the toggled status however since it can't find the node I'm at a loss.

var vec = Vector2(0,1000)
var ori = Vector2(0,0)
func _ready():
    pass

func _on_Ally1_Button_toggled(button_pressed):
    if button_pressed:
        set_position(ori)
        $Player_Button.set_pressed(false)
    else:
        set_position(vec)

This is what the tree looks like.

enter image description here

The Player_Ally1_ui is trying to access Player_Button but as stated it can't seem to find it and just returns null.

Any help is greatly appreciated, thank you in advance.

Source Link

Cant find sibling node, keeps giving "null instance"

Im trying to set it up so that there are three buttons but only one can be toggled at a time. So when one button gets toggled it makes sure that the other two are not toggled.

The code is trying to set the toggeled status however since it cant find the node im at a loss.

var vec = Vector2(0,1000)
var ori = Vector2(0,0)
func _ready():
    pass

func _on_Ally1_Button_toggled(button_pressed):
    if button_pressed:
        set_position(ori)
        $Player_Button.set_pressed(false)
    else:
        set_position(vec)

This is what the tree looks like.

enter image description here

The Player_Ally1_ui is trying to access Player_Button but as stated it cant seem to find it and just returns null.

Any help is greatly appreciated, thank you in advance.