Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Syl |
Greets!
Got a singleton var torch = null, and i want it to be checked at the start of my scene, so wrote something like that:
extends Node2D
func ready():
if GlobalP.torch == "lit":
$BGD.visible = false
so that my black BGD/background keeps being invisible if the player is coming from a scene with GlobalP.torch == “lit”.
BGD sprite is right under Node2D, GlobalP.torch is changed in a previous scene with that:
func _on_Torch_pressed():
GlobalP.torch = "lit"
and yet that doesn’t work, and the scene keeps being in sheer darkness…