Good day, I'm new to godot. I am working on a platformer game where all dna card(collectables) are all queued free, a gate will open for the next level but I am confuse why the emit signal won't work even all the collectables are queued free.
So this the code where the all queued free collectables counted and send signals(I think)
`extends Area2D
signal rockon
func _on_body_entered(body: PhysicsBody2D):
queue_free()
var dna = get_tree().get_nodes_in_group("dna")
if dna.size() == 1:
emit_signal("rockon")`
And this the code for opening the gate. This script is on my root node of the scene
`extends Node2D
func _ready():
$dna.connect("rockon", asdf)
func asdf():
$gate.queue_free()`