Godot Tidbits: Global Signals (Event Bus)

Поділитися
Вставка
  • Опубліковано 1 лют 2025

КОМЕНТАРІ • 38

  • @Bargeral
    @Bargeral 4 місяці тому +13

    I've always connected to signals via the ready() function, and never bothered to disconnect them. Using the tree enter and exit is much cleaner, thanks for that tidbit.

    • @zongopbongo
      @zongopbongo 4 місяці тому +3

      it should ensure the signal is disconnected when queue_free-ing which is nice!

    • @tullman3craggs102
      @tullman3craggs102 17 днів тому

      YOU'RE A WIZARD BARGERAL! What's a ready? Function? Signal? Come back to hogwarts

  • @ckay7816
    @ckay7816 3 місяці тому +4

    What a glorious solution! I was having such a hard time understanding connecting signals in Godot and dreading the task, but now i see how simple it really is! This video should be linked in the documentation page for signals!

  • @Boblikescheese
    @Boblikescheese 6 місяців тому +8

    Phenomenal tutorial, exactly what I was looking for when handling signals with dynamically loaded objects! Very informative and straight to the point

  • @EidoEndy
    @EidoEndy 6 місяців тому +6

    Amazing tutorial. Global signals are something I’ve been trying to wrap my head around for a while (for making a bullet hell). and this does a good job explaining it.

  • @adrianmakes
    @adrianmakes 6 місяців тому +8

    This was just what I was looking for! Thank you! I’ve been using an auto load with getters and setters which is working fine, but this will work a treat!

  • @donaldedgarvisuals
    @donaldedgarvisuals 5 місяців тому +4

    Thank you so much for making this! Super helpful and only one I could find that deals with dynamically loading objects. Update: watching this finally fixed a problem Ive been trying to resolve for a week of setting Z_Index of multiple instances of objects so that whatever the last clicked object was is on Z_Index 1 and everything else sets Z_Index to 0. Thank you!

  • @drendelous
    @drendelous 17 днів тому +1

    amazing explanation. i stumbled upon a video on this topic and it hurt my brain. this one is super nice

  • @brandonstone2754
    @brandonstone2754 4 місяці тому +6

    This guy needs more likes/subs this was great

  • @Games-vu9nz
    @Games-vu9nz 4 місяці тому +3

    Thank you for the beautiful and useful explanation.

  • @avinsxd
    @avinsxd 7 місяців тому +4

    This is a great tutorial! Very underrated

  • @sestalacto
    @sestalacto 28 днів тому

    Thanks, This is just what I was needing.

  • @ThaAftrPartie
    @ThaAftrPartie 6 місяців тому +6

    4:51 it’s not random, it’s based on the scene save. So if you save a scene from within the script menu, and say are on a different script, that script you’re writing’s scene now becomes the original script’s scenes’s thumbnail.
    Just go into the editor and re-save the scene with the area you want shown

  • @grymmjack
    @grymmjack 5 місяців тому +3

    Great video thank you! Also explained the Singleton thing. So we need to extend Node for our autoload Singleton? Does the autoload automatically get loaded in EVERY scene then?

    • @WouterLockefeer
      @WouterLockefeer 5 місяців тому +2

      Yes and yes. Autoloads extend Node by default, so no need to worry about that.

  • @MrGramno
    @MrGramno 7 місяців тому +3

    Very interesting video i learned about the on scene enter and exit signals :D

  • @1steditionoutlet
    @1steditionoutlet 29 днів тому

    I would love to see a tutorial like this, but for a whole game!

  • @huachimingoX
    @huachimingoX 5 місяців тому +2

    thanks you explained very well

  • @simonsaysgray
    @simonsaysgray 5 місяців тому +2

    thanks, great video!

  • @igork1336
    @igork1336 6 місяців тому +2

    very good tutorial

  • @deniskkd6262
    @deniskkd6262 5 місяців тому +2

    You are awesome🎉

  • @chiubaca
    @chiubaca 5 місяців тому +1

    Any downsides to this approach or suggestions when this is a bad idea ?

  • @rremnar
    @rremnar 2 місяці тому +1

    To prevent a value going above the array length,
    clampi(value, 0, array.size() - 1), using clampf if using float
    To wrap it around:
    value = (value + 1) % array.size()
    or if it's a float
    value = fmod((value + 1.0) , float(array.size()))

  • @Notreal76
    @Notreal76 6 місяців тому +2

    Thank you for this tutorial

  • @Ocdib
    @Ocdib 5 місяців тому +1

    Hi! Just checking on the _on_tree_exiting signal... Is this signal triggered when the object `queue_free`s? What's its purpose?

    • @mikefrom1974
      @mikefrom1974  5 місяців тому +1

      This signal is triggered whenever the object leaves the "tree" (the hierarchy representing the currently running level). It's a way to ensure something is done BEFORE a node is gotten rid of, including queue_free

    • @Ocdib
      @Ocdib 5 місяців тому +2

      @@mikefrom1974 I see. Is there any consequence of leaving a signal attached AFTER queue_free? What are we safe guarding against?

  • @EidoEndy
    @EidoEndy 6 місяців тому +1

    Quick question, why do you need to disconnect the signal when leaving the tree? Is the listener still in memory or something?

    • @mikefrom1974
      @mikefrom1974  5 місяців тому +2

      This is just a safety net to prevent weirdness and null errors if a node is no longer in the tree but somehow not completely gone form memory.

  • @mandu9520
    @mandu9520 2 місяці тому

    What if the squirrel's hand gets bitten off by a lemur?

  • @nvm9174
    @nvm9174 6 місяців тому +2

    thank you man

  • @MathGoOli
    @MathGoOli 5 місяців тому +1

    I've linked the bombs on the basic level scene that all level scenes inherits.

  • @tracotr
    @tracotr 7 місяців тому +3

    Dude ty

  • @mbg4681
    @mbg4681 3 місяці тому +1

    *_Axe Squirrel!!!!_* *guitarsolo*

  • @alfredogodoy6854
    @alfredogodoy6854 7 місяців тому +2

    noice video