So, I have two scripts, one has you tap a button, and upon tapping, will change a variable to "true", which is in another script. However, it isn't working as expected. The button is pressed and works correctly, but doesn't change the variable to true.
Scene tree: https://gyazo.com/c437b8d29f83640487cb8e571586fabc (The img HTML tag doesn't want to work.)

Tapping Script:
extends RichTextLabel
# Things that actually make the game work
var counter = 0
var timer = 0
var pressed = false
# Power Up Varibles
onready var powerSign = false
func _ready():
# Tell what to do when the "Play" button is pressed.
set_fixed_process(true)
set_process_input(true)
self.set_text("Money: $0")
func _fixed_process(delta):
# Tap, Gain, Repeat...
var press = Input.is_action_pressed("Press")
if press and not pressed:
print("Tap")
counter += 1
self.clear()
self.add_text(str("Money: $", counter))
pressed = press
# Enough tapping, lets get rich!
func _on_Timer_timeout():
# Open Sign (Add +$1 a second)
if (powerSign == true):
counter += 1
self.clear()
self.add_text(str("Money: $", counter))
print("Added money (powerSign)")
Buy Button Script:
extends Button
# Variables
onready var powerSign = get_tree().get_root().get_node("World/Counter").get("powerSign")
func _ready():
set_fixed_process(true)
func _fixed_process(delta):
pass
func _on_Button_pressed():
if (powerSign == false):
powerSign = true
print("Button Pressed, it should work...")