Hi, I'm making an Asteroids clone with Godot. The MainScene generates a number of asteroids, making new ones appear when another one gets out of screen, and the Player script generates bullet when the shoot key is pressed. I've been trying to use signals to connect the onbodyentered on the Bullet script, but the only workable function I found uses getchild(0) which doesn't return the right instance. I also don't really know where to emit the signal from!
So far I have :
b = Bullet.instance()
b.transform = $Muzzle.global_transform
and on the Bullet scene :
and in the ready of Bullet :
connect("bullet_collision", self, "_on_Bullet_body_entered")
Oh and the collisions work fine when they're not instances. Thanks!