I've been stumped on this for hours.
I have a check box, and what I expect to happen is that when the checkbox shows "On", the player can open a menu, where they can place they're own objects into. If it's "Off", they cannot use the menu no longer. But this is not the case, even though it prints that it is indeed set off, it doesn't change it at all.
Spawn Menu.gd:
extends Control
onready var text = get_node("Panel/ItemText")
onready var devMode = get_node("/root/Scene/Player/Menus/Pause Menu/DevCheckButton").get("devCheckBox")
func _ready():
self.hide()
func _process(delta):
#self.set_position(player)
if (Input.is_action_just_pressed("ui_spawnMenu") && devMode == true):
self.show()
elif (Input.is_action_just_pressed("ui_spawnMenu") && devMode == false):
self.show()
elif (Input.is_action_just_released("ui_spawnMenu")):
self.hide()
func _on_Button_mouse_entered():
# text.set_text(objectScene)
pass # replace with function body
Development Button.gd:
extends CheckButton
var devCheckBox = true
func _ready():
print(is_pressed())
pass
func _on_DevCheckButton_pressed():
if (self.is_pressed()):
devCheckBox = true
else:
devCheckBox = false