I thought he was going way too fast, but I have the personal opinion that this is beginner level stuff that should be taught properly. This guy is clearly not a teacher, and probably on Ritalin. I can slow it down obviously, but it sounds terrible.
Basically signals are "events" triggered by actions and you "listen" to them with listeners (connect), and callables are basically "closures". I come from a web background in JS :)
Wow, you actually got through to me after about a dozen videos explaining signals. I think you naming them silly things actually helped, cause naming them something useful in tutorials makes me feel like that custom name is supposed to mean something X)
Good video nad labs :) I think "function as a variable" would be a better simplified definition of a callable. The reason Godot 4 signals have changed from 3 is because Functions are now first-class. This means they're a Class (Callable) and can be assigned to variables and passed into functions like any other class (rectangle, sprite, Vector, or any other Node). Also it's preferable to use the reversed Godot 4 syntax of Object.signal.connect(Function:Callable) and signal.emit() to reduce the use of strings and actually take advantage of the first--class nature, iirc the syntax you're using is just a hold-over from 3.x Also also, if the function is simple enough, you can pass in an anonymous/lambda function instead of the name. This is good if you only use the function in one place and don't want to write it out somewhere else signal.connect(func(): print('hello world')) or something like that absolutely shivering in anticipation for the next vid 😳
I watched somebody else's signal video that was 2 years old. I kept getting errors. It wasn't Godot 4. Duh. After watching your video, it's all good now! Thanks!
Oh, nice! That's a really nice way of communicating between parent and child nodes :O Also, I absolutely love your enthusiasm and the way you teach. Great stuff!
well done, but I would like to know how I can connect a signal to another node, through code, in your case, you call a function located in the same script, I would like to point to another target (that when you are connecting, you are connecting to another node, to call a function of that node), how can I do that?, in godot 3 I knew how to do it, but here it has changed
@@15plus1 Yes, but try to tell me what is your problem, what do you want to connect, and I will try help you. Tell me the node you want to connect to the other node (both names)
The only thing I dont get: Couldnt the area also call get_parent().asdf() Why is there a need to be a signal? Is there any advantage other than signals dont crash on "null" errors? I agree the area could have a parent that doesnt have an asdf() function, but if my game has that for sure is there any other benefit?
Signals help keep code modular so like you said, if you are certain your structure won't change then it may not be the best use case for signals. I think signals are best utilized when two or more nodes are connected or if you want to account for nodes being there sometimes but still connect seamlessly to the code.
I just noticed something and I have a question. The 4th time the OogaBoogaFunction is called, it sometimes doesn't print the mouse entered/global mouse position line before the program exits. And then sometimes it does. I wrote a version of this exercise where I had a 'print("Destroyed!")' line in the asdf function just before the 'get_tree().quit()' statement. And sometimes it would show. Other times it wouldn't. The execution sometimes jumps ahead to the 'get_tree().quit()' before the printing happens. How would you prevent that, I wonder? Anyone's comments would be welcome. Thanks.
I really don't understand. Although I do as I was told in the video, if I type in the 2nd script: $Character.connect("damagePlayer", self, calculateDamage) The error that appears is: *Unexpected "$" in class body* The only thing I want is to send the damage value that Character has to the enemy. How should I actually use the signals?
extends Area2D func _ready() -> void: connect("body_entered", sword_hit.bind(body)) func _process(delta): pass func sword_hit(body): emit_signal("hit", body) I have this script where i wanted to connect area2d body_entered signal to a defined func called sword_hit , but i need the body attached to it. So the body can be pass to another signal called `hit`. this is the error i met, `Line 4:Identifier "body" not declared in the current scope.` Please help Q_Q
lol does someone have you held hostage? good explanation but slow down man. Also why do all these tutorials have the classic microphone on the desk with you slapping the keyboard.
You sound like you were held at gunpoint and told "explain the basics of signals in Godot in a clear and simple manner within 5 minutes." Great video.
As it should be. Concise, factual, with relatable examples.
I thought he was going way too fast, but I have the personal opinion that this is beginner level stuff that should be taught properly. This guy is clearly not a teacher, and probably on Ritalin. I can slow it down obviously, but it sounds terrible.
Thanks. All the other tutorials have a lot of "let's make a billion unrelated things and then there's a signal in the middle, watch out for that" bs
Finally a no-fluff explanation with practical examples and an avoidance of standardized naming conventions. Thank you!
Basically signals are "events" triggered by actions and you "listen" to them with listeners (connect), and callables are basically "closures". I come from a web background in JS :)
I've seen like eight different videos about signals, and this is the first one that actually explains what the callables are. THANK YOU.
Hey thank! This by far the most coherent tutorial others just keep talking about built-in one and rarely give any examples for costume signals
Fast, informative, straight to the point. Thank you!
after an hour or so this is the only video that worked. Thanks!
Wow, you actually got through to me after about a dozen videos explaining signals. I think you naming them silly things actually helped, cause naming them something useful in tutorials makes me feel like that custom name is supposed to mean something X)
Djfjrkckskzkcmcn
Dude great video one of the very few that explains it simply and clearly
Good video nad labs :)
I think "function as a variable" would be a better simplified definition of a callable. The reason Godot 4 signals have changed from 3 is because Functions are now first-class. This means they're a Class (Callable) and can be assigned to variables and passed into functions like any other class (rectangle, sprite, Vector, or any other Node).
Also it's preferable to use the reversed Godot 4 syntax of Object.signal.connect(Function:Callable) and signal.emit() to reduce the use of strings and actually take advantage of the first--class nature, iirc the syntax you're using is just a hold-over from 3.x
Also also, if the function is simple enough, you can pass in an anonymous/lambda function instead of the name. This is good if you only use the function in one place and don't want to write it out somewhere else
signal.connect(func(): print('hello world')) or something like that
absolutely shivering in anticipation for the next vid 😳
So far you're the only channel which explains this the right way it should be used: via the code and not through the editor.
Thank you so much for this clear and simple explanation , That video is so underrated and it deserves a lot more likes.
I watched somebody else's signal video that was 2 years old. I kept getting errors. It wasn't Godot 4. Duh. After watching your video, it's all good now! Thanks!
Thank you! You have no clue how many hours I've been trial-and-erroring signals until this video
This video is getting me closer to understanding! Thanks for this.
Thanks for this video. Pretty coherent and takes the time to explain all the major concepts
simple and straightforward, noice
Brilliantly explained, appreciate the concise tutorial
Oh, nice! That's a really nice way of communicating between parent and child nodes :O
Also, I absolutely love your enthusiasm and the way you teach. Great stuff!
This really helps a lot, thanks mister.
I don't know why but this tutorial felt so... agressive? It was very useful though, everything was quite easy to comprehend and it helped me.
"I know custom signal sounds scary but it's not" XD
Best explanation i've heard so far, thank u 🙏
Excellent video! Exactly what I needed to learn about hooking up signals.
The talking a mile a minute was actually a nice contrast to some of the slow tutorials I've seen. Also, the oogaboogafunction had me dying.
amazing and short 🙏thank you again
well done, but I would like to know how I can connect a signal to another node, through code, in your case, you call a function located in the same script, I would like to point to another target (that when you are connecting, you are connecting to another node, to call a function of that node), how can I do that?, in godot 3 I knew how to do it, but here it has changed
Did you find a solution so far? I´m still looking for one ...
@@15plus1 Yes, but try to tell me what is your problem, what do you want to connect, and I will try help you. Tell me the node you want to connect to the other node (both names)
This guy would teach you math and insult you so you remember love it
Thank you very much, this was very very useful.
that was an amazing speedrun
This is the best insult and compliment ever 💀
Thank you! Very helpfull to fully understand signals :)
Dudes going places, keep it up!
Thank you, late night understandings
Fantastic video
Great video!
insanely helpful, thank you!!!
that, was amazing
You the goat. Thanks bro
most excellents, many thanks, good sir
finaly i understand
Godot 4 Signals [Speedrun WR]
Extremely Valuable!
Great video, right to the point as always 🙂
The only thing I dont get:
Couldnt the area also call get_parent().asdf()
Why is there a need to be a signal? Is there any advantage other than signals dont crash on "null" errors?
I agree the area could have a parent that doesnt have an asdf() function, but if my game has that for sure is there any other benefit?
Signals help keep code modular so like you said, if you are certain your structure won't change then it may not be the best use case for signals. I think signals are best utilized when two or more nodes are connected or if you want to account for nodes being there sometimes but still connect seamlessly to the code.
Subscribed! 😎😎
I just noticed something and I have a question. The 4th time the OogaBoogaFunction is called, it sometimes doesn't print the mouse entered/global mouse position line before the program exits. And then sometimes it does. I wrote a version of this exercise where I had a 'print("Destroyed!")' line in the asdf function just before the 'get_tree().quit()' statement. And sometimes it would show. Other times it wouldn't. The execution sometimes jumps ahead to the 'get_tree().quit()' before the printing happens.
How would you prevent that, I wonder? Anyone's comments would be welcome. Thanks.
ty for great video
"ogabooga" is the best example I could've asked for.
And that’s why I do it like that
blink twice if you are ok
thx
Nice, thanks!
it was awesome
here me out best signal tutorial for godot 4 it's latest and up to dated 🙌
counterpoint: there is no counterpoint
i love you
I love you
How do I do this between scenes?
I really don't understand.
Although I do as I was told in the video, if I type in the 2nd script:
$Character.connect("damagePlayer", self, calculateDamage)
The error that appears is:
*Unexpected "$" in class body*
The only thing I want is to send the damage value that Character has to the enemy. How should I actually use the signals?
slow down bro, we get it you have experience
extends Area2D
func _ready() -> void:
connect("body_entered", sword_hit.bind(body))
func _process(delta):
pass
func sword_hit(body):
emit_signal("hit", body)
I have this script where i wanted to connect area2d body_entered signal to a defined func called sword_hit , but i need the body attached to it. So the body can be pass to another signal called `hit`.
this is the error i met, `Line 4:Identifier "body" not declared in the current scope.`
Please help Q_Q
can you make tutorial to pass variable through signal?
Newbie question. Whydont call a function inside world as get_node?
What does the "-> void" do?
Goated
when will you mix rip and tear
lol does someone have you held hostage? good explanation but slow down man. Also why do all these tutorials have the classic microphone on the desk with you slapping the keyboard.