diff --git a/scripts/DropsBase.gd b/scripts/DropsBase.gd index 9c6a9aa..ed0b742 100644 --- a/scripts/DropsBase.gd +++ b/scripts/DropsBase.gd @@ -12,9 +12,12 @@ var _sfx_player: AudioStreamPlayer func _ready() -> void: body_entered.connect(_on_body_entered) - witch = get_node("/root/Game/Witch") + witch = get_node_or_null("/root/Game/Witch") + player = get_node_or_null("/root/Game/Player") + if witch == null or player == null: + queue_free() + return collected.connect(witch._on_collect) - player = get_node("/root/Game/Player") _sfx_player = AudioStreamPlayer.new() _sfx_player.stream = _collect_sfx _sfx_player.volume_db = -18