![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | PsychicGoldfish |
Hello! I’m trying to make a button that makes a Spatial node and it’s children invisible.
onready var LL = $lightscar
func _process(delta):
if Input.is_action_just_pressed("engine"):
engineEnabled = !engineEnabled
print(engineEnabled)
if not engineEnabled:
LL.visible = false
I keep getting Invalid set index 'visible' (on base: 'null instance') with value of type 'bool'.
when I try to use it! How can I fix?
Hi.
The error means that LL is null and not an object. Therefore the problem arises from:
onready var LL = $lightscar
are you sure that $lightscar is correct?
klaas | 2021-07-07 08:12