I have 3 sprites A, B and C, each one has area2d attached to it and collision shape
the script for A
extends Area2D
var done = 0
func _input_event(viewport, event, shape_idx):
if event.type == InputEvent.MOUSE_BUTTON \
and event.button_index == BUTTON_LEFT \
and event.pressed:
get_parent().hide()
done = 1
And all like that
Now the main node has a script attached to it
extends Node2D
func _ready():
if get_node("lA").get("done")==1 && get_node("B").get("done")==1 && get_node("C").get("done")==1:
get_tree().change_scene("res://scenes/scene2.tscn")
But it doesn't work, why?
The error when doing if get_node("lA").done == 1
is
Invalid get index 'done' (on base: 'Sprite').
What I'm trying to do is collect some items, when done, move to a new scene