Understanding signals in Godot (A QUICK GUIDE).

preview_player
Показать описание
If you use the Godot Engine then you've probably heard of signals

This video comprises of some come common use case for signals
(Not the best use cases)

You can donate to me on flutterwave
(Help upgrade my potato PC)

It's just a guide to get comfortable using signals and some tricks you might find useful

0:00 - Intro
0:23 - How to make a custom signal
2:08 - How to connect multiple nodes to a signal
2:42 - How to connect signals using code
3:32 - How to connect signals from a singleton to a node
4:07 - How to use the built-in signals

If you make any purchase using these links I will recieve a commission (I will be paid by amazon)

I also edit videos, you can contact me @
or

Music by LiQWYD:

#Godot #Tutorial #gamedev #Nesi
Рекомендации по теме
Комментарии
Автор

Your video edits are really nice.
Now, I wouldn't recommend to use the code you're showcasing here. You're making things more complicated than they need to be and coding like that may backfire in Godot: with many signals you end up with spaghetti code that's hard to keep track of, with extra variables you increase the chance of having bugs. Here are three alternate solutions to the problems you showed here.

1.You can export a variable of type NodePath and when moving the node around the tree in the editor, the path will update automatically (it has some limitations but it's like signals). The syntax is export (NodePath) var player_node_path.
2. You can use a RemoteTransform node to track and follow another node. You could have a Node2D as a child of your camera with a RemoteTransform2D attached to it. This remote transform can track the player, and you can then have the camera smoothly move based on its child. This way, you don't need the signal and the boolean to check that the start signal was emitted; avoiding any extra variables you have to track will help you avoid bugs.
Note there's a more powerful option and that's the third point below.
3. Any node can move independently from its parent. To do so, in a function like _ready(), call set_as_toplevel(true). It will make the node work in global position, as if it didn't have a parent. And this way, you can have your bullets as a child of the player! Not only that, you can also have the camera in the player scene, removing the need for the remote transform node.

Gdquest
Автор

A very well done tutorial. Reminds me of one of those unreal/unity tutorials. Maybe make a series about every single concept? And maybe make this one video but with barren/new project kinds of feels so that the audience doesn't need to know what player script is etc.

8/10 bro gj

tengkuizdihar
Автор

Nice have a better understanding of it now💯

oluwafisayomioludare
Автор

I find this quite funny (I don't mean it in a bad way). Kudos!

vnen
Автор

Loved this video, and the way you explain things. You just got yourself a new subscriber!

CharlExMachina
Автор

If you keep being entertaining while teaching stuff, you will be my new favourite Godot channel c:

AlvaroLand
Автор

If it wasn't for the singleton (3:12), wouldn't connect("signal", Target, "method") break, whenever I connect to a normal node as Target that gets moved around?

nosdregamon
Автор

Nesi is my friend in case y'all didn't know😌

lemonxl
Автор

man are you colorblind the way you use colors is different just curious no offense

pai
Автор

This is really well done. Could you speak a little bit more clearly? In a couple of spots I can't tell what you are saying.

kimholder