Это видео недоступно.
Сожалеем об этом.
Signals in Godot 4: Everything You Need to Know as Beginner
HTML-код
- Опубликовано: 17 авг 2024
- In this video we cover the basics in using Signals in Godot. This video should help you understand better how to trigger events and pas information between scenes by using signals and get insights into how they work together with other nodes to convey the message to another node. This explains the basics of
Video about Area2D: • Area2D in Godot 4: Eve...
Video about Movements: • 2D Movement in Godot 4...
00:00 Intro
01:01 Short Setup
02:10 Connect Signal by Editor
03:56 Connect Signal through Code
05:56 Customized Signals
06:15 Emitting Customized Signals
07:30 Connect Customized Signals
10:12 Recap Customized Signals
10:57 Advanced concepts
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! ❤
I think this finally got signals to make sense to my brain. Thank your for the breakdown on emitting and connecting signals.
Hahaha, I am very happy it helped!
And I totally feel you. I have spent my own few hours of frustration trying to understand them 🙂
@@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 so much! Great explanation video :D
Thank you, I'm glad you liked it! 😀
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 RUclips offers a few videos explaining them if you search for it.
@@LioGoesIndie hi. Thank you very much for explaining the autoloaders concept. Will try that going forward. Thanks.
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 🙂
Keep up the good work!!
Thank you for your cheers! :)
I wish you did area3d signals instead of button signals.
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.
@@lv99redchocobo37 ohh my, the times this had me at witts end too.
Happy you solved it 🙂
based man
Great video, good tutorial! just try zooming in more; it's hard to read the letters.
Thanks mate!
Yes, I agree. I also have to achieve a higher video resolution to support that.
I hope the next one will be better *fingerscrossed*