Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | mymokol |
Say there’s a function that instances a scene into the main scene.
func shoot(args): var projectile = preload(path).instance() projectile.position = (formula for calculating position) projectile.velocity = (formula for calculating velocity) $background.add_child(projectile)
however, i also need to reach a child of the projectile node, Area2D, to connect its body entered signal to the main scene. Is there a way to do it before adding the child, or do i have to do it after using $background.get_node()?