• Godot Help
  • Why can't my script receive more than two signals?

Hmm.. okay. Then maybe the OP is overriding the signal instead of creating a new one?

  • Zini replied to this.

    Zini Editor can do multiple connections per signal too

    I experimented with that. It works, but it could be confusing, especially to a beginner.

    This is how I'm connecting the signals.

    I click on the red squareIsGreen() icon.

    I choose Sprite, then click connect.

    When I go to the script attached to Sprite, the on_Square functions are connected, but the on_Zone functions get disconnected.

    Is there another way to connect the signals?

    How do you connect onZone functions? Are both squares and the zone all instances of the same scene?

      xyz

      I click on the red icon.

      Then choose Sprite and click connect.

      Godot will then disconnect the on_Square functions and connect the on_Zone ones.

      This has probably something to do with scene structure. It'd be best if you could make a minimal project and attach it here so someone can give it a look.
      With your screenshots you didn't provide enough information. We don't see the exact scene structure, we don't see which scripts are attached to which nodes and we don't see full paths/names of signal callbacks. With all that information missing, figuring out what's wrong is a guessing game.

        OofStatement

        I just realised "Sprite" was the Zone only. I confused myself by not having a SquareSprite and ZoneSprite. Gonna try fix it myself.

        • xyz replied to this.

          OofStatement
          There are quite a few issues.
          in scene square:

          • node Square has the signal visibility_changed() connected to a missing method _on_Square_visibility_changed(). Godot issues an error in the debugger exactly describing the problem.

          in scene Gameplay:

          • in script QuestionZone.gd you declare two signals zoneisGreen and zoneisRed. In the same script you try to emit those signals using names zoneIsGreen and zoneIsRed (uppercase "i" instead of lowercase) so signals are not found. Godot issues "non-existing signal" errors in the debugger specifying which signal names are non-existing.

          • there are couple more signal connections from Zone node to non-existing methods but I'll let you figure that out yourself from the debugger error messages. They clearly state the problems.

          However, all 4 signals you were talking about are in fact connected. You can see this by looking at the signal connections in the inspector/node tab where everything is listed. If connection is listed there then it exists. Note that even though a connection exists the callback function the signal is supposed to call still may be missing (as you can see in the first problem I described above).

          What confused you was that little green arrow/door icons were missing in the code editor. That's because you have the same script attached to nodes in different scenes. When you look at the code from within a particular scene it will show you icons only for connections in that scene, i.e. it shows those icons in context of the scene you're currently editing. I suggest you avoid having the same script attached to nodes in different scenes, at least until you get better understanding of how signals operate.

          In general your scene structure looks overcomplicated for such a simple logic. Poor scene organization resulted in convoluted signal connections that are hard to follow. You should rethink it and simplify the system.