How to prevent child instances of main to start automatically?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Whiskerando

It might sound a bit silly, but I cannot find information on this.

I am developing my first basic shmup, and I have trouble instancing my other scenes to the main.

If I add an instance to the main using the Scene window, that instance will play automatically at the launch of the main scene, instead of waiting for the signal to do so.

Example 1: I add the “Player” scene as child instance of main, creating the sprite for the player character. The sprite would be there immediately from the start, under the HUD, while it is supposed to appear only after the user has clicked the Start button to remove the HUD.
Example 2: The Player scene has a child node for the projectiles the user is going to shoot. I set it up using get_parent().add_child() so that the projectile becomes a child of main, not Player, so that its position is not dependent of the Player node. But now that the projectile is a child instance of Main, it starts automatically when I launch the main scene, and I can see the projectile crossing the screen under the HUD instead of waiting for input.

So is there any way we can add a child instance to Main but prevent it to be triggered automatically? Does that even make sense?

In some case I was able to go around this issue by using export “PackedScene”, but I run into another problem. If I do this for the Player scene for example, it does work by spawning on command and not automatically, but I lose access to all the signals from the Player Scene since it is only a PackedScene and not directly present as a child of main. The signals would not show up in the Node tab, nor calling the signal by code seems to be functional. This is an issue for example to signal collision, etc.

Thank you very much for helping a newbie!

:bust_in_silhouette: Reply From: BraindeadBZH

I would follow a tutorial like: https://www.youtube.com/watch?v=sKuM5AzK-uA

Thank you very much BraindeadBZH, I am on it !

Whiskerando | 2019-07-10 18:48