So I'm making levels for a 2D platformer. One of the things I decided to add at the beginning of a level is a Life Screen scene that plays before you can play the level. Basically like in Super Mario Bros., where there's a screen that tells you what level you're about to play, how many lives you have, current score, etc. While this screen is displayed, I don't want enemies to move, so that if I have a level where an enemy is on-screen and on the same level as the player, the player doesn't get hit at a time where player input is disabled. My solution to this is to auto-set the enemy script to idle, and only be given permission to move once the life screen is gone. Basically, here's the logic:
- Scene starts
- Life Screen timer autostarts
- Timer ends
- Signal gets sent
- Life Screen disappears
The issue: I have to individually connect the signal to each individual instance of an enemy. It's not auto-connected to all enemies, so every time I generate a new enemy in a level, I have to connect the signal to the new instance, otherwise the new instance is stuck in idle mode. This can be time consuming, and frustrating when I forget to connect it to a new instance. I just want to know if there's a way of automating the process so each new instance could be auto-connected to the signal.