How to Create UPDATING Health Bars in Godot 4
Вставка
- Опубліковано 22 кві 2023
- In this video we are going to go over how to create updating health bars step by step in Godot, health bars are really important but this video goes hand in hand with creating any type of UI element that you need in your game, health bar, stamina bar, etc. Having a health bar in your godot game can make your game look much better because now you are able to see the players health while playing the game!
Download Free art pack: game-endeavor.itch.io/mystic-...
make sure to download the free as that is all we will need for this series.
Link RPG Godot 4 series playlist: • How to Make an RPG in ...
----------------------------------------------------------------------------------------------------------------------------------------
Thank you so much for watching I really hope this video helped.
if you did enjoy then please go and click that subscribe button to help out the channel. I means so much and I love your feedback in the comments to let me know what it is that you enjoyed. Again thanks so much and I would love to see you again!
have a great rest of you day and of course be safe :)
- thanks DevWorm,
----------------------------------------------------------------------------------------------------------------------------------------
Typical gamer: *dies to enemy* -> goes into files to nerf the enemy instead of getting good.
Lmao but seriously sometimes there is no way that U gonna get good, grinding is waste of time and no fun
One of the best tutorial series I've ever seen. I understood Godot better in a hundred minutes than in other brain-burning hour-long series. thank you.
so glad to hear!!!
Great video! This helped out a lot, and I also have a note that I would like others to read:
If you want the ProgressBar to be a UI element, add Canvas node on your Player's scene, and and make the ProgressBar a child of the Canvas node. The Progress bar is now a UI element that displays wherever you want.
"Dude, you are literally a genius!" Is what I kept saying out loud when I saw the finished product of each video. To everyone reading, this dude is literally the greatest. He is funny, explains the code, walks you through, etc. He has helped me start on the path of achieving my dream of being a Game Developer. I subscribed immediately within 5 minutes of the first video. I am so excited to see more GODOT tutorials! Thanks, DevWorm! Keep up the amazing work!
thank you so much brother!! this made my day!! Hope I'm able to keep helping you out more and more! If you ever need anything then please let me know!
@@dev-worm Sounds awesome dude, I'd love to stay in contact. I'm glad it made your day! As soon as I finished this video I went around showing everyone 🤣
Back to back videos I love it!
Hey man, I went through all of this playlist and honestly found them all helpful. Yea, it's not the best way of doing probably any of it but what a great learning exercise to clean it up... maybe add some composition and a state machine? Those are my next steps. Thanks for the playlist, definitely subbed and liked it all.
Long time animator, first time programmer. I've been enjoying this playlist of videos, they have been extremely helpful making my own first project. I'd really love to see a tutorial on giving a player a dash or roll, its the one thing I have been struggling a lot with and it's driving me crazy.
i loved this tutorial. it was very fun to do and you explain the process very well. i have zero exp with game making and i could understand it well enough to follow it. cant wait to start another one
so glad to hear that!
thank you so much for this guide. you are the goat. going to build off this now, thank you. had a lot of bugs i ran into but was able to overcome them : )
so happy to hear that
Thanks For The Tutorials!!!
Just
Very Helpful And Easy To Understand For Me Who Didnt Have Any Coding Knowledge And Bad With English.
AlreadyFinished The Tutorial And Now Trying To Improve By Myself.
Cant Wait For The Crazy Tutorials Project You Talked About!!!
coming really soon!
Thank you so much dev-worm for all your hard work in making this series. I can't believe how easy it is to create an actual video game. I am going to have so much fun making and playing my own game!
glad they were helpful! thank you!! It means the world to me! Goodluck on your game dev journey! and if you ever need help then dont be afraid to reach out!
Awesome video!
Thank you for your contribution to the Godot 4 community ❤
thanks bro, many more to come soon!
@@dev-worm Hey man, thank you so much for the tut. Please do not stop :)
thank you very much for the playlist , it helped me a lot the day I started my project !
i typically play games where the healthbar was visible at all times. I decided to make it the way you did in your video and I'm glad I did. Absolutely no errors or issues encountered! :D I can't wait to check out your other videos like your Survival Game tutorial!
thanks!! and glad it was helpful! if you ever need anything then please let me know!
@@dev-worm i greatly appreciate it! I just now watched your survival video for moving in all 8 directions and tried adding that (and commenting out the 4 direction movement). Now, the movement is all messed up.
Walking animation doesn’t play and neither does the attack animation.
And the directions that I coded in the script (from that video aren’t making the player move in those correct directions).
I’m using Godot 4.2 btw. Is there a way I can fix this?
Thank you so much for these - i am making a godot game for my thesis in univesity and it helped me alot.
so glad I could help!! if you need anything specific then please let me know!
I love ur content bro, never stop doing that
great video and series. much appreciated!
thank you so much!
Great tutorial. I will definitely check more!
so happy it was helpful!! thank you! if you need anything then please let me know!
Hi!
I have now ignited the game and I find it really easy thanks to you!
This was also my first game I did with Godot.
I would like to ask if you could not maybe continue the series because there was an update to the assets pack with skeletons and new map sharing!
Would be really cool!
Have a new subscriber❤
so happy to hear!! thank you so much!! maybe Ill start to think about covering more topics with this series!
Great tutorial from start to finish thanks !
happy to hear! thank you!
Thank you for these, they're very helpful
glad to hear that!
Keep up the good work!
Instead of doing
if health 0:
Anyways, great tutorial, I've learned so much from this series!
Awsome series !
You are the GOAT, awesome tutorial
Glad it helped!! thank you!
@@dev-worm Hey, i have one question, how would i make the enemy slime stop all of the idle and other animations and play a "hurt" animation when it gets hit? I searched on the Godot forums but most of them were unanswered. And some were too complicated.
After going through this series, I just wanted to say that it was super informative and great! I know some comments were like, "Why didn't you do THIS?" or "If you did THIS it would've been a lot easier" or "THIS would be the way to make it more readable", but I really enjoyed how you walked us through what you did and WHY you did it in your way. It's helped someone like me who has some beginner knowledge of Game Dev and coding kind of see how and why someone like me could approach a project like this.
Thanks for your hard work, and I can't wait to see your future tutorials!
so glad i could help, so much coming really soon
Awesome guide, I learned a lot :) I will now try to implement changes to it.
glad you learned a lot! huge tutorials coming soon so you can try to implement them into this game. like dialogue
Great series
thanks!! hope it provided lots of value!
Well thank you, i watch this all. This is easy mechanics, but looks good for beginner
thank you so much!! goodjob!
Thanks this looks amazing #subscribed
Thank you!
Thank You Sir.
of course anytime!
Thanks, man
thanks brother! hope it was helpful!
Thanks
Great tutorial! I feel a lot more comfortable with the interface now, and have a good idea of nodes the gd script now, as well as camera + world building. I was even able to pause your tutorial and finish the tasks you started in a couple of the videos, and more or less ended up with the same solution.
I do have one problem though, it seems the cooldown for the player dealing damage to the enemy doesn't seem to work. I still seem to one-shot kill him. Can't figure it out!
Have a lot more confidence to push through and start my dev log journey! Thanks
thank you for sharing, i am so happy to hear that!! it means the world to me!! remember if you ever need anything just let me know!! i’m so proud of how much you have been able to learn goodjob!
Could you make a tutorial on collecting let’s say gems and when you pick one up it adds a gem to the ui under the health bar
Hey, amazing tutorial you have but I have a problem I can't figure it out. When the player attacks it instantly kills the enemy and it was working before impleting healthbars. Could you share your github repository for me to compare or give me some help?
5:10 Can you give a more detailed explanation on adding the health bar on different corners? (E.x top left?) Im a bit stuck
If you wanted to make the healthbar be in a fixed position of the screen, you would probably want to have a different scene to handle HUD stuff. There are many tutorials for making HUDs in Godot so I'm sure you could find one to help you with that. Hope this helps!
Bro pls make more parts this game can be made more good
how would you go about making an enemy play a attack animation if using your script. I tried using the same as the player but it wont work
Ayo, any plans to get into procedural generation, of maps and enemies and all that?
can you do a tutorial on the animation finish func that the animated sprite has
Thank you so much for this tutorial sereis but I am unfortunately having trouble exporting this particular project.
Nevermind figured it out lol. I just had the wrong files setup in my editor settings & was rendering the wrong scenes.
glad you were able to fix it!! Goodjob!
Парень спасибо за уроки !
Can you make a tutorial on how to make dpad for mobile control?
Finishing up the whole series now, I love it, really appreciate your effort in creating something beautiful, fun e nice to follow along while we learn about Godot. Nothing is better than to learn by doing. Thank you @dev-worm 🥰😍😍
Glad you like them! Thank you so much!! it means the world to me that it was such a help!!
can this work for 3d games? like having the health bar display on the enemies?
idk why I'm getting an error after healthcare.value = health. identifier "health" not declared in the current scope
bro can you make a video on how to add a death animation
great video, but i was wondering. how do we use the death animations that got inserted into the animated sprite 2D?
I attempted to do it but the enemy just keeps on dissappearing before the animation plays out.
I haven’t tried and I’m not very good at godot since I just started but using the knowledge I gained from this series I would say make a wait() in your code after the animation then make the enemy disappear or make a timer to implement into your code
I just checked this and if you add a timer to the enemy and say if health is 0:, you also have to go to the else (the one where right below it, it goes to idle animation) and change to elif not player_chase and health > 0:, that should make it work you just have to set the timer so the death animation plays right
I watch all yr tutorial and ihve done make all off it. I need more can u add gathering resource like mining cutting tree
that would be something important to cover.. thanks for letting me know! Ill start looking into creating a tutorial over it!! thanks for the idea!
I wonder, I see that all these videos were released 9 months ago, did you all release them at the same time?
I'm going back to episode 1 to continue the tutorial... xD
they were all around the same time yes! I think maybe 2-3 days in-between each one!
I just don't understand the semantics of gd script...
E.g. we had multiple times in the source: "if boolVar == true:" -> Can't you use "if boolVar:" ?
We process the health bar always in the physics function, why not just implement it in a setter of the player/enemy health?
(there are more "unusual" source lines)
I'm really missing something here, it would be nice to explain all the things that would be solved differently in other languages...
Besides of this:
Thanks for the videos!
I wanted to add an obstacle that would damage the player when it touches it but you didnt show the way to code a dmg system..
How do we apply death animations tho? I tried playing the animations before calling queue_free on both the player and the enemy but didnt worked. Any help maybe?
i had that same exact problem. Any ideas on how to apply them? :c
@@julieazure6994 I don't remember the project but in general I think now that if you want something to die you connect a signal from a hurt box area(area 2d node) to the node that you want to die and after you get reference of the area in code you say e.g.
HitBox.set_deferred("monitorable", false)
animation.play("death")
await animation.animation_finished
queue_free()
Not too sure though if you can try something like that.
@@thesomeone2nd thnx a bunch. Definetely trying that 👀👌🏻
Id like to ask if there is any possibility to turn that health bar into hearts in the top left screen (for the player) and top right screen (for the enemy)? Much thanks ❤
I believe you would need to use Textureprogress , which allows you to put in the heart texture rather than using a default progress!
@@TheMaJestic14 I still am completely clueless on how to do that 😅
@@GalaxyJammed its kinda hard explaining through text , will try to find you a video but you own me a sub deal? XD
@@GalaxyJammed this video goes over what you want i think , its godot 3.5 but not much changed except some lines ua-cam.com/video/7A4EPIr-6Sc/v-deo.html
@@TheMaJestic14 tysm ill give it a try
I have a problem, when the enemy hits me and I receive damage and then I heal, my character becomes immortal because he no longer receives damage and I entered the code as it appears in the video, can someone help me?;-;
How Can I respawn the enemy in the same position after 20 sec when he dies?
when ever you die you zoom out do you know how to fix it
Is this the last episode?
hey wondering about re spawning and adding more enemy ( like randomly spawning them in your map ) and thank you for the vid
edit: im also wondering about making the movement wasd instead of arrow keys
to change the input you would need to go to project settings, input map.. then change what keys do what accordingly. respawning enemys is coming soon in the survival series that Im currently working on.
Regin timer? I think you mean Regen 😂
Thanks for the info tho
can you show all the script from the beginning to the end
Bro can you please upload a video about platform enemy ai Pathfinder with auto jumps pleasssseeeeee❤❤❤😀😃😃😃😃😃
Please explain how you do a control of phone, your follower from Morocco 🇲🇦🙏🏻❤️
working on a series for a mobile game
If your healthbar is not showing up, it is because the healthbar cannot be higher than 100. You have to set up the healthbar to 100. To avoid this and use custom health, I added a variable "max_health" and set the healthbar to the max_health of the Player or Enemy instance. And also: If your health is not regenerating, do not forget to activate "Autostart" on the timer.
func update_health():
var healthbar = $healthbar
healthbar.max_value = max_health
healthbar.value = health
if health >= max_health:
healthbar.visible = false
else:
healthbar.visible = true
func _on_region_timer_timeout():
if health < max_health:
health = health + 20
if health > max_health:
health = max_health
if health
im begging you to upload this whole project, I cannot get the enemies to take or give damage and i've watched the whole thing twice, I really need help :,(
Mines the player wont give damage lol. enemy hits me just fine
Do you continue this series with invetory system?
working on an really good inventory system tutorial that will be uploaded in like one day!
Its been a month
no signal 'timeout' method not found... idk what going on.
when i run app it's running but not regen any hp.
Ok there was my bad. I cleared all and repeat from zero and all work properly.
Bro im making rpg game but i have so much bugs 😢😢😢
give as the link of Project pls🙏🙏
sorry i forgot to add it to the description, ill make sure to do it on all future uploads
i hope you can provide source code
Nice! i wanna kiss you!. ty for all. hopes see future videos with 4.1. always something change. likes delta. i had to change to _delta
lol 12:07
YOU SAVED MY LIFE THANK YOU SO MUCH MR DEVOLOPER WORM]
MR DEVELOPER WORM IS THE CLUTCH KING