Leave an emote in the chat if you liked the video! Get notified upon new tutorial releases by subscribing and hitting the notification bell! 🙂 Thank you so much for your support! ❤
@@LioGoesIndie I was mostly having trouble with the idea of connecting to a signal. A lot of tutorials don't break down what each part of a piece of code means. So I'd just name things like they have it and be left unsure of what it even means.
Thank you for this tutorial. Signals simplified. Can you please show how can we connect signals in scenes which are neither the child or sibling of each other.
Hey there. That is possible if you connect them to a standalone script. You would make this script global and connect the signal of your emitting node in this global script through code. When receiving the signal, you would emit a second signal from this global script. You can connect the signal signal of the global script through code in your receiving node and run the code. It is not technically what you describe and not too much different than forwarding the original signal up your scene tree, I know, but it's the closest I currently know. This is briefly mentioned at the end of the video where I say there are Singletons (that is the name of a global script). I am far from creating a video on these, but RU-vid offers a few videos explaining them if you search for it.
One suggestion. Just have your player emit a health_changed event in all cases with the new value. Then have your HurtFrame handle the calculation logic for the overlay. If you decide to use 25% instead of 50%, for example, then you only have to change the logic in one place.
Thank you for pointing this out! As I am still learning programming myself, comments like yours help me to improve myself, so thank you a lot for taking the time 🙂
I have a question: Is there a way to make two scene communicate if the scene that need to receive the signal is being instanciate in the other one (instead of being there from the beginning)?
Hello! I answered something similar above, not sure if this covers you. Basically if you want to break with Godot's convention of signaling up and calling down the scene trees, what you would like to try are probably global scripts aka singletons aka autoloaders. Don't know all the workarounds myself yet, so if you find a way that works for you, I'd be happy if you can share to learn something new myself 🙂
Hey red chocobo 🙂 Connecting a signal from any node works just the same as presented in the video. No matter if it's a 2d, 3d or UI node. You can find the inbuild signals of a node in the window to the right in the node tab besides the inspector tab. Dobble click a signal and connect it to the desired script. The syntax to connect via code is also the same --> node_name.signal_name.connect(name_of_function).
@@LioGoesIndie thank you. yes I figured out my problem. I was choosing the wrong signal. I was using area entered when i should have been using body entered.