You made me understand signals! Didn’t think I would be able to get it ^^
@dev-worm4 ай бұрын
so happy to hear!! thank you so much!! that means for than the world to me!!!
@N3verGiveUp4 ай бұрын
Duuuuude..... I've been trying to do something similar to this for over a week and have done it 27 different ways and finding this got it to work... you are a legend and have helped with a lot of stuff i've been busy with. You champion!!
@dev-worm4 ай бұрын
so happy to hear!!! thank you so much!! it means the world!! I am so glad it was able to help you out!! if you ever need anything then please just let me know!
@AndyAndrewEntertaiment5 ай бұрын
Ex-Unity user here. Just wanted to tell you that I was on the edge to go back to Unity after trying to get a signal between RayCast3D and an Animation player. Your tutorial was a life saver!
@dev-worm5 ай бұрын
so happy to hear!! how's Godot been treating you??
@AndyAndrewEntertaiment5 ай бұрын
@@dev-worm Good, for now. As I said, if you didn't made this super ex-Unity frendly tutorial, i would have gone back to Unity. thanks again!
@TheMegamanan5 ай бұрын
Personally, as an Ex-Unity aswell, i like Signals so much more than Events
@AndyAndrewEntertaiment5 ай бұрын
@@TheMegamanan Now I love them too, but I didn't understand them and now I feel a bit dumb...
@YoshimiMilk5 ай бұрын
Godot is not a Unity replacement though, but its nice to see you did not give up.
@edwardskeyara2 ай бұрын
I want you to know i appreciate you talking fast, my brain runs fast and everyone else is super slow.
@dev-worm2 ай бұрын
i happy to hear that it was perfect for you!! thank you so much!! i am just so glad to help!
@MrMelonMonkey11 күн бұрын
@@dev-worm hey, i dont dislike fast talking generally becuase i like it when you get to the point quick. but in your case i find it difficult to follow your rather "sloppy" pronunciation, as im not a native speaker. if you could talk a little more clearer it would be highly appreciated. and not just by me i figure ;) thanks for your awesome tutorials anyways, though.
@YoKKJoni5 ай бұрын
very helpful and clear! i heard 4 minutes and i figured it out thank you
@dev-worm5 ай бұрын
so happy to hear that! glad I could help! thanks! if you ever need anything then please let me know!
@kristianlovealot8 ай бұрын
Thanks, Devworm :) Just what I need to get a better understanding of signals! Can't wait to watch this later!
@dev-worm8 ай бұрын
thank you, I'm happy to hear that! I hope the video is able to help you understand signals a bit better!
@Cvrchak8828 күн бұрын
Absolute gold mine of knowledge! Awesome!
@dev-worm28 күн бұрын
Glad to hear that!
@Trupen8 ай бұрын
Thanks DevWorm
@dev-worm8 ай бұрын
of course! anytime!
@PunCala8 ай бұрын
Great job once again. As is tradition, some topic suggestions: camera that always pans slightly to where you are looking at, cutscenes where you move the player and an npc with animations, cutscenes with dialogue, updating your dash video from years ago to Godot 4 (fixed distance dash or some other type of dash).
@dev-worm8 ай бұрын
working on dash as we speak. thanks for the ideas ill look into them more!
@PunCala8 ай бұрын
@@dev-worm Thank you! Btw if you're working on the camera thing, please watch Game Maker's Toolkit video for reference: kzbin.info/www/bejne/ipW6d62mnNOfoNU
@Saint_Oscar3 күн бұрын
I am perfectly fine with how fast you talk. The complainers will need to pause the video anyways to follow your scripting. They can playback at a reduced speed.
@tuckerwoollard26134 ай бұрын
for those it may not be working for the "if body.has_method("Player"):" line in the enemy script is a way to check if a body enters does it have a func inside it named and in this case "player" so you can slap that into your player script for your enemy to detect and then transmit damage and its a unique func only to the player
@ReddleyYT8 ай бұрын
Thank you, love your guides! You've become one of my favorite Godot channels!
@dev-worm8 ай бұрын
so happy to hear that, glad im able to help.. if you ever need anything then please let me know!
@Goldy131992Ай бұрын
Very well explained as always, keep up the great work!
@dev-wormАй бұрын
thank you so much!! it means the world!!
@lmullins573Ай бұрын
Thank you man. This answered so many questions that I had. 🙏
@dev-wormАй бұрын
so happy to hear that!!
@Juicein8 ай бұрын
This is just what I needed! Thank you!🙏
@dev-worm8 ай бұрын
Glad it was helpful!
@dasuper118 ай бұрын
I just came over from your RPG tutorial series, and I have to say that while it sounds like you have gotten more confident in your videos, you are also talking and doing stuff a lot faster. I feel like the pacing would benefit from you taking your time a bit more. Other than that, great video!
@dev-worm8 ай бұрын
thank you, yes you are correct.. i am working on trying to breakdown everything in newer videos.. this one was pretty quick and i didnt like it to much either.
@pixelsapling29 күн бұрын
I needed this so much thanks
@dev-worm28 күн бұрын
i hope it helped!
@Bk157298 ай бұрын
Thanks man. Needed this
@dev-worm8 ай бұрын
so happy to hear that!
@electricelf-music5 ай бұрын
You have no idea how long I have been searching for the answers that are well given in this video lol
@dev-worm5 ай бұрын
so happy to hear!! thanks!
@steve_rico2 ай бұрын
Very useful. Next research step is to understand how to pass these through an Event Handler script so I can scale my game and make multiple instances
@901oi22 ай бұрын
man i love your videos
@dev-wormАй бұрын
thanks bro!! it means the world!!
@hemapoojari6307 ай бұрын
The fact that I was watching the video without full screen and when he requested us to subscribe the subscribe button got a colorful border of neon colours for a fraction of seconda😅😅😅😅 I loved it 😂😂😂new feature huh
@dev-worm7 ай бұрын
ah really?? must be.. that seems cool lol
@tomod458 ай бұрын
thanks for the tutorial!
@dev-worm8 ай бұрын
of course anytime!
@sergeym72136 ай бұрын
Thanks for the tutorial, but what is the best way of connecting a signal emitted by another scene?
@USNTM26 ай бұрын
There's the event bus pattern. I recently saw a quick video on it on a channel called SaltyTheGeek (name stuck out). Essentially, from what I understand: Make a singleton called EventBus In the singleton, put any signals you need or want In your listener object's ready function, connect its function to the EventBus signal you needed Lastly, when the conditions are met, use the caller object to emit EventBus.emit_signal("your_signsl_here", parameters_here) Edit: the other channel (Salty) gave basic code on a pastebin. There wasn't any explanation other than loose comments in the code. But I got value from it because I watched the implementation and was able to understand the comments.
@Garthritis2 ай бұрын
Good stuff! Thanks
@dev-worm2 ай бұрын
thank you so much!!
@mincraft7525 ай бұрын
Hey i love your videos u make everything so easy to understand . Can u please make a video about how to use this inventory plugin the documentation is quite hard to understand the plugin name is gloot v2.4.6 the latest version. i cannot send any links because my comments are being disappearing.
@dev-worm5 ай бұрын
ill check it out, thanks!!
@mincraft7525 ай бұрын
@@dev-worm Thanks!!!
@MochiRosu8 ай бұрын
MCSquirmy the Legend!
@dev-worm8 ай бұрын
@MochiRosu the Legend!
@IronBen1174 ай бұрын
super helpful, thanks!
@dev-worm4 ай бұрын
thank you so much!!! glad it was helpful!!
@Lambert06Pasquale065 ай бұрын
Thank you. I will subscribe. I hope to learn from your videos. My question is, do you narrate these tutorials all in one breath? XD Jokes. They're really good. I started with intro Python and great Godot learning course early this year and it's like emotional epilepsy. What did come to mind was one of my best breakthroughs for understanding python was "100 days of programing with Python" on Udemy. I did only 7 days that was somehow posted on youtube, but none the less, doing many small incremental quizzes help massively. If I was a great programmer I would make the same thing for Godot. But self drive and not hand holding is best of course.
@spasmodius8939Ай бұрын
thanks!
@dev-wormАй бұрын
of course anytime! thank you!
@christo30583 ай бұрын
This was very good and valuable! Many thanks. If it is possible for you to talk slower, that would be appreciated. Beside that technical detail, good job!
@dev-worm3 ай бұрын
thank you! Im sorry about the talking speed and I will note that for future videos as I understand how it can be hard to receive information that way!!
@shoggoth5 ай бұрын
In example2, why not just have one signal and pass the colour as a parameter?
@SheepUndefined5 ай бұрын
I don't really get why you'd use has_method() and *then* call a signal on the object like that. That kind of feels like using signals to skirt around what is more or less already a bootleg interface pattern to me. (Bootleg only bc Godot forces us to duck type instead of using interfaces for some reason.) Just call the method, and stick to signals for bubbling up or global subscribable events that you don't want coupling on, this is adding extra complexity by using signals where they aren't needed.
@watcx3 ай бұрын
He's just teaching horrible practices because he doesn't understand what he's doing himself.
@ElementalTJ8 ай бұрын
You are the best!
@dev-worm8 ай бұрын
thank you so much, youve just made my day! If you ever need any help with Godot then please let me know!
@fvhaudsilhvdfs8 ай бұрын
could you clarify the significance of the signals and functions working together but passing differently-named variables? in example 3, the signal passes the variable "damage", and then the connection to that signal passes the function "damageAmount". I'm a bit confused about this part. how does Godot know what variable passes where when they're named differently? also, what is the practical purpose of being able to do this? (that is, why not just keep the names the same?)
@hadesiguess85168 ай бұрын
I’ll split my answer into two parts to try to answer your questions better. Part 1 will be about how Godot handles differently named variables, and part 2 will be why this feature is useful. 1) You can think of the variable's names as placeholders for the useful information being passed through. Naming a variable just allows you to show the program what to do with it like to set the amount equal to 20 for damage or subtract that value from health. When the function take damage is called it only knows the inputs value regardless of what it’s named where the function is being called 2) In the example given there is no need for differently named variables as it was a very simple situation. In a more complex situation, you might have multiple different variables you would pass through depending on the current state, where you’d need more than 1 variable name so they couldn’t be the same. My answer was a bit longer and more complex than I’d like so let me know if you are still confused. I’m also not the most experienced at coding so anyone else please correct me if I explained anything incorrectly.
@dev-worm8 ай бұрын
@@hadesiguess8516 that is a very good explanation of it
@fvhaudsilhvdfs8 ай бұрын
thanks for the detailed reply. regarding #1, I'm still confused about how Godot "knows" which variables are which in the case of multiple differently-named variables being passed. is it the order they appear in?@@hadesiguess8516
@GrunkleSoos8 ай бұрын
In addition to @hadesiguess8516 I just wanted to say that the way Godot knows which value to put in the renamed variable is by the order they are passed. So the first value passed will always go into the first variable and the second into the second etc.
@cg2713_Ай бұрын
I have a question when you apply signals to an object and duplicate that object why don't the signals get saved to that duplicated object? also how do you connect signals to an instantiated object?
@dev-worm29 күн бұрын
so to apply signals to an instantiated object, you would have to create a connect function within the receiving node, and in the instantiated node emit a signal from the script. So you wont be hard coding signals like we are doing here but instead creating a new one within the code and connecting it through the scene tree and through sometimes an autoload
@Frostbytedigital8 ай бұрын
I still dont get the point of custom signals. You couldve just called the method directly on the node. Ill use built in collision and control node signals but the custom ones still havent clicked with me.
@thesomeone2nd8 ай бұрын
If you continue using godot there will be a time where you gonna need them
@Frostbytedigital8 ай бұрын
@thesomeone2596 ok. For what? I'd love to know any "need" case. I have heard that you can't call methods of a node unless it's the child of the node, so you have to "signal up" but that isn't the case in the current godot version at least, you can call functions on any valid node that you can reference. I'm not saying there aren't use cases, I'm saying I haven't been able to find one that is simpler or better by another other metric Ive detected than just calling the method that is triggered by the signal I could've used.
@sataStrike8 ай бұрын
You rarely NEED signals, but it's a very useful pattern that is easy to understand when it's triggered, as well as decoupling your code to maximize reusability and refactorability. Just think of all the built-in nodes. They all don't care about the other parts of your code because they use signals. So you can reuse those nodes as often as you like. This flexibility is achieved through the signal system. You can also google observer pattern or listener pattern, as that what signals actually are.
@USNTM28 ай бұрын
Needing a signal would be like a player object that is a child of the game world having a sibling that is the player's health bar. The health bar should not have anything to do with what's going on with the player's health, it just displays the value given to it. When the player's health changes, the player should emit a signal that is health changed, the new value, and whatever listeners are listening (the display) will do what it needs to do now that it has new information to work with.
@bingusbingus78608 ай бұрын
Not sure if it’s optimal, but I emit a signal from certain creatures when the right timing/rng is met. This signal connects to the world/main and produces a dropped item given the location of the creature. Good example of this would be a chicken dropping an egg. Or a pig rooting up a mushroom. Or whatever. It’s abstracted to the point where the world has a function on_drop_resource that only needs an actor and a resource id.
@AngelofD000M5 ай бұрын
This is a fantastic tutorial, thank you so much! Although im sure it wont bog it down too much, but instead of calling the update_health function in the process method, why not put it in the take damage method, outside of the if statement? Over all, the entire thing will update, and no need to call it every frame.
@dev-worm5 ай бұрын
good call out! must have had a brain fart! sorry I have no idea why I did that lol.. seems silly! but thanks! and glad the rest of the tutorial was good lol
@AngelofD000M5 ай бұрын
@@dev-worm I appreciate the videos you make, they're concise, to the point, and gives plenty of different explanations on when to use them, and how to use them. Please keep making more videos, cause I know they helped me a bunch, and I'm positive they'll help others too! BTW the brain fart happens, its all good lol
@iamcookie117029 күн бұрын
instead of using body.has_method("player") it'd be a better practice to make the player a class using class_name player at the top of the script and then check if body is player
@cadenthornton945117 күн бұрын
Hi! Do you have any advice on sending signals from nodes that are not yet in the scene tree? For example, if you wanted enemies to spawn in waves and send signals to the player.
@kaloyantoskov681813 күн бұрын
I am stuck on the same thing. Did you find an answer
@cadenthornton945113 күн бұрын
@@kaloyantoskov6818 I have not lol. Communication between nodes has been my main difficulty with Godot.
@Asilhan5 ай бұрын
Thanks for the tutorial passing variables in the signals very useful but what if we create a node in signal? if bullet_cooldown == false: var new_bullet = bullet.instantiate() new_bullet.global_position = global_position var dir = global_position.direction_to(body.global_position) direct.emit(dir) #new_bullet.direction_2 = dir #call_deferred("add_child",new_bullet) add_child(new_bullet) bullet_cooldown = true bullet node: func _ready(): $/root/World/Player.connect("direct",shoot) func shoot(direct): direction_2 = direct This code gives me 2 error. 1) It says: "E 0:00:01:0455 player.gd:48 @ _on_gun_range_body_entered(): Can't change this state while flushing queries. Use call_deferred() or set_deferred() to change monitoring state instead." whenever I spawn a bullet. 2) Bullets spawn when a enemy enter the range of player. But they don't move until another enemy moves in and only then it moves to closest enemy.
@Twisited8 ай бұрын
thanks
@rangergreen19356 ай бұрын
So, idk if you or anyone else can help me here. Idk if im just trying to brute force this the wrong way or what. SO, I set my first signal on my animation to "on animation finished("spawn")" for my spawn animation to transfer into the idle one. But it refuses to let me apply the same logic to the damage animation going back into the idle one. Any idea what im doing wrong? It seems like there's just one output per signal but that has to be wrong
@dev-worm6 ай бұрын
hm, not sure what is going on. you should try and start looking into creating a player state machine, because once your player gets more complex having a state machine is going to make things a lot easier... for the issue you are having now I have no idea! Is there any errors? have you tried print checking to make sure it engine is running through the code successfully? I really dont know what could be the case I'm sorry!
@brisben883 ай бұрын
Why do you create a method to identify bodies instead of defining groups? It makes no major difference as far as I can comprehend but it'd be good practice to define your bodies as part of a group and then use is_in_group to identify the body? Am I missing something?
@dev-worm3 ай бұрын
no you are completely correct about that! unsure why I do it this way but thanks for pointing that out as I shouldnt be teaching this and I should be showing group and classes! thank you and sorry about this little hickup!
@brisben883 ай бұрын
@@dev-worm no worries, thanks for the clarification!
@Alikespan5 ай бұрын
Hey devWorm, amazing video but i didnt found what I was looking for so im asking in comments: I got a Pause Menu scene with buttons and script. I got the resume button to work but I cant figure out the exit button. After i click it I want it to queue free itself and the level im on and then I want the main node to add Main menu scene as its child so I can pick a gamemode again. How can I do it?
@MrGramno8 ай бұрын
I have one question about signals, i have a player scene and a bullet scene. The bullet scene emits a signal if an area enters its area. So the question is how can i connect that signal to the ui, because the bullet is not in the scene it is instantiated with a button press ?
@InsanityForce8 ай бұрын
You can do it by code. If your bullet scene already has a script , probably in the bullet's _on_ready or_init() function, or another on that's called immediately after creation. Else, you can do it in the code that instanciates it, by connecting to the Bullet's Area2D (or whatever) 's signal. Not quite as clean as it requires other objects to "know" how missiles are built. The code would be something like : # if done in the bullet's script, "collided" is its signal declared in its script. self = the bullet, argument of UI's function on_bulley_hit(b : Bullet), Bullt being the bullet script's class_name. bullet_collided.connect(UI.on_bulley_hit.bind(self) ) # if done in the script that instanciated it : bullet.collided.connect(UI.on_bulley_hit.bind(bullet) ) # if bullet doesn't even have a script, assuming you use a Area2D and area_entered is the Area2D's signal. bullet.get_node("Area2DName").area_entered.connect(UI.on_bulley_hit.bind(bullet)) # with UI's on_bulley_hit(bullet : Sprite2D or Node2D or whatever)
@tonnypedersen59158 ай бұрын
you could use a autoload singleton script and store you custom signals in that, that way dynamic loaded objects can communicate more easily.
@mkaks22gamerserise164 ай бұрын
bro there is one issue you teach so fast and i am a beginner i need some time
@dev-worm4 ай бұрын
sorry bro! if there was anything you couldnt understand feel free to ask me! Im sorry it was all a little to quick!
@JanusKjempff5 ай бұрын
The way Godot uses signals is a wrong use of observer pattern. You should never have an object know their observer. To use correct observer patterns in Godot you should NOT use the signal emitting in the inspector; instead let your observers subscribe to the signal with code - Now your components are de-coupled aka they don't know about other components in your game = de-spaghettification and correct object oriented design.
@SheepUndefined5 ай бұрын
Yeah I kind of noticed this myself when I tried to swap from Unity. I kinda prefer using a Bus pattern nowadays for most signals that aren't just bubbling up. Basically a singleton object that does nothing more than storing custom signals that other objects can call and subscribe to.
@snugglyjeff2147 ай бұрын
talk slower!
@dev-worm7 ай бұрын
okay! sorry, ill try!
@andrejjjj20085 ай бұрын
No, don’t! ❤
@ObsydianX5 ай бұрын
Playback 0.75 worked for me.
@biggusdickus67044 ай бұрын
Indeed we have ways of slowing down if needed that’s good. But also kind of understand the comment up there. Might be good. In the end, the content is nice, thumbs up anyway.👍🏻
@ParacosmTV2 ай бұрын
Definitely talk slower, wtf. Lol
@lazlohollyfeld37702 ай бұрын
Decent Tutorial but damn slow down.
@dev-worm2 ай бұрын
i do apologize!! hope you were still able to get the information from it!
@lazlohollyfeld37702 ай бұрын
@dev-worm I do appreciate the effort and time it is hard to put yourself out there. Was just a little paced with your fast brain vs us slower people.
@JuanDiaz-ks7xy8 ай бұрын
Hello, do you know of another way to pass arguments in built-in signals, like in the ‘pressed’ signal of a button? I found this method: button.pressed.connect(my_func.bind(my_arg)), but I’m curious if there’s another way
@chefaku6 ай бұрын
when connecting the signal 3:23 click on advanced, and you can add arguments
@Moonajuana5 ай бұрын
This is exactly what I needed, thank you so much!
@dev-worm5 ай бұрын
happy to hear that! thank you!
@ThunderPlayStudiosАй бұрын
it's my first time i've to slow down a video. :D btw great content
@dev-wormАй бұрын
haha i’m sorry!! i hope it was still helpful!! thank you so much!! ❤️
@cadenthornton945117 күн бұрын
Hi! Do you have any advice on sending signals from nodes that are not yet in the scene tree? For example, if you wanted enemies to spawn in waves and send signals to the player.
@jitone15 ай бұрын
I was trying to use the connect method to connect "open" signal to chests in multiply level scenes. Never go it to work right.
@Pelipcahh8 ай бұрын
Can you make animations in one scene and then use signals to play them when an input is pressed in another scene? For example in your survival tutorial you have an arrow scene and before the arrow moves forward, during the charge (that I added to the bow where you have to hold the input for 1 second before an arrow flies) an animation is played where the arrow is pulled closer to the player and then it flies forward as described in your tutorial when the input is released.
@thesomeone2nd8 ай бұрын
Yea it sounds totally possible
@Epsio06 ай бұрын
Need help clarifying something. I have a scene called ammo that I want to emit a signal to update a AnimatedSprite2D node. The AnimatedSprite2D node is a child node inside of a regular node, which is also a child node that's instance inside of my CharacterBody3D node (which I have saved as a player scene). I have a 3D node called world where both, ammo scene and player scene have been instantiated (I pressed the chain link icon in the scene window). How do I connect the signal through different nodes that are instantiated as a child scene? So imagine, in your second example, if the Example2Player has inside of it another node that I want to access.
@NamEch886 ай бұрын
Hello DevWorm! Your video is really helpful. Hope you can guide me on how to make a roguelike game like Brotato!
@dev-worm6 ай бұрын
hey thank you so much! I'm actually working on a rogue like game tutorial series right now!
@NamEch886 ай бұрын
@@dev-worm Great! I look forward to it
@WunderChilld8 ай бұрын
Thanks for the videos brother, could you bring a video explaining how to enter/use some type of vehicle? whether horse, car, etc.
@ongbui17962 ай бұрын
On example 3 could I switch it around like instead of the enemy damaging the player could I use the same code but the player is the one damaging the enemy?