How to Make a Great Health Bar in Godot 4 | Let's Godot

Поділитися
Вставка
  • Опубліковано 22 січ 2025

КОМЕНТАРІ • 142

  • @kardrasa
    @kardrasa Рік тому +84

    I challenged myself to make this from my head without doing the tutorial and I did it! Lets g0000!

    • @DashNothing
      @DashNothing  Рік тому +19

      Lets go brother, good job!

    • @vickylance
      @vickylance 8 місяців тому +1

      Did you implement it in any different approach?

    • @DT-hb3zu
      @DT-hb3zu 5 місяців тому

      0:19 is where I'm commenting from.
      At first, I would think that there would be two health bars overlaid.
      The top bar moves down by percentage based on the hit.
      The second would stay, and only move down if the top bar hasn't moved in some arbitrary length of time.
      If the top bar value

    • @ayoungartistakajack6799
      @ayoungartistakajack6799 Місяць тому

      Dot

  • @mannig.faltigkeit2341
    @mannig.faltigkeit2341 Рік тому +53

    The fact that you showed the general idea of the solution in the beginning (0:30) makes this tutorial S-tier in my book. ❤

  • @Indiemat
    @Indiemat 11 місяців тому +4

    Great tutorial, very helpful! Keep up the good work!

    • @DashNothing
      @DashNothing  11 місяців тому +1

      Thank you so much! I appreciate it dude!

  • @Hindriux
    @Hindriux 9 місяців тому +5

    Amazing tutorial, especially the fact that you use the Healthbar as a component. Too many people just add canvas layers or add a healthbar directly to their scene. Thank you!

  • @QuietPenguinGaming
    @QuietPenguinGaming 10 місяців тому +2

    Your tutorials are SO good!! Thank you for making them :)

  • @asdf12337
    @asdf12337 8 місяців тому +4

    I tried to implement this myself the last two days in my 3D isometric, but for the player health (tried to implement it into Camera script which I set as parent of the HealthBar). Thank you so much for this! Very nice and clear explanation, even though the part writing the actual script was a bit fast. Can't wait to get home and try it!

    • @zac9933
      @zac9933 3 місяці тому

      First time I watched a tutorial of his, I literally had the video on half speed during the script 😂

  • @DeavtheDev
    @DeavtheDev 7 місяців тому

    Bro this works wonders! You explained it so perfectly and it actually works! Also the way you set it up it can be used for multiple different things such as players and enemies! Thank you so much! Liked the video and subscribed!

  • @D.E.Nicolas.Goncalves
    @D.E.Nicolas.Goncalves 10 місяців тому

    It was super valuable, it opened up a logic in my mind that can be used in other types of systems, THANKS!

  • @madeyslime
    @madeyslime Рік тому +13

    quick suggestion: instead of making the damage bar snap to the right value after the combo, you can use a tween to make it move towards the right value! so it's smoother

    • @SleepyLazyPanda
      @SleepyLazyPanda 5 місяців тому

      Nice, but I don't know how to make a tween, would it work with a ease function or something?

    • @madeyslime
      @madeyslime 5 місяців тому +1

      @@SleepyLazyPanda yea but tweens are way better, i suggest you look into them !

    • @SleepyLazyPanda
      @SleepyLazyPanda 5 місяців тому

      @@madeyslime ok thanks !

    • @madeyslime
      @madeyslime 5 місяців тому +1

      @@SleepyLazyPanda you're welcome !!

  • @yellowduckgamedev
    @yellowduckgamedev Рік тому +4

    If you are making a fighting game, i would highly recommend to only change the damage indicator once a combo ends.

    • @felipezymor9970
      @felipezymor9970 6 місяців тому

      In case of someone that needs that, the way I did is the following:
      1: Disconnect the timeout signal from the Timer of the HealthBar
      2: Change the set_health function:
      func _set_health(_new_health):
      var previous_health = health
      health = min(max_value, _new_health)
      value = health

      if health timer.time_left:
      timer.disconnect("timeout", _on_timer_timeout)

      timer.connect("timeout", _on_timer_timeout)
      timer.start()
      else:
      damage_bar.value = health

  • @Gamewithstyle
    @Gamewithstyle Рік тому +1

    Very cool tutorial! Saving this one and will use it soon! Thanks man

  • @jundevelop
    @jundevelop Місяць тому

    This is TOP quality tutorial🗣️

  • @martinithechobit
    @martinithechobit Рік тому +1

    Thank you. A simple aspect of a game but the work into it. Ty.

  • @DerpyEinstein
    @DerpyEinstein 2 місяці тому

    I simply missing a simple piece of information that was left out of other tutorials I was looking at. Thanks.

  • @zeqobopro9328
    @zeqobopro9328 6 місяців тому

    Thank you so much for this bro. you explained it very well

  • @thecfyhx6180
    @thecfyhx6180 11 днів тому

    I had an issue with the implementation because the health variable is assigned before setting the max_value and value variables. As a result, when the setter for the health variable is called during initialization, it used the wrong values for max_value and value.
    To fix this, i simply set those two variables before i set health.

  • @ghb323
    @ghb323 Рік тому +1

    This should be standard in all video games because unlike numerical HP displays, a small damage is barely noticeable if displayed as a bar without a damage indicator where as numbers, you'll see the rightmost digit change (assuming no damage number shows) as numbers are very distinct visually than a bar.
    At 5:25 I would recommend swapping the damage and health to represent the amount healed in the event that HP is greater than previousHP.

  • @rejecht_3042
    @rejecht_3042 5 місяців тому +2

    you can also spice up your healthbar by tweening it. It would look twice as better.

  • @user-arabic-s5b
    @user-arabic-s5b Рік тому

    I just started learning Godot. This is helpful thank you 🌹

  • @verigg6598
    @verigg6598 9 місяців тому +8

    The init_health function will not work because we have changed the var health : set function.
    In init_health the first two lines should be like this:
    max_value = _health
    health = _health
    then it will work correctly.

    • @pavelkrastev2949
      @pavelkrastev2949 9 місяців тому

      You are a life-saver!

    • @Baannia
      @Baannia 5 місяців тому

      Found this too )

    • @Lutnar
      @Lutnar 5 місяців тому

      do you know why I'm getting null value on damage_bar in set_health function and same in init_health ?
      I did one to one from video changed what you wrote and still nothing

    • @verigg6598
      @verigg6598 5 місяців тому

      If you get an error like this: “Attempted to call function 'init_health' in base 'null instance' on a null instance.”
      Most likely you are trying to change values on a heatlhBar that has not yet passed _ready(). If you are trying to set the value of a heatlhBar, during the _init() of whoever owns it, move that to _ready().
      If you just can't change the value, check again that you haven't made a mistake in the code. Check that you may have forgotten @onready somewhere.

  • @LazystonerStudio
    @LazystonerStudio 11 днів тому

    Yeah, that'll be useful for later. Thanks!

  • @TheJazzygeoff
    @TheJazzygeoff Рік тому

    Thanks, this was excellent, and I used it to make a 3D version that takes this and just makes a Sprite3D "Billboard" of it for my 3D game. I also put in a little tween as some have asked for so that the white part moves smoothly after the timer timeout.

  • @Heemiez
    @Heemiez Місяць тому

    my damage bar just becomes a giant box when i try to full rect anchor and I cant change the size

  • @philipjones4974
    @philipjones4974 2 місяці тому

    Let's godot is an amazing name. You go man!

  • @ohhave3586
    @ohhave3586 Рік тому +1

    do you have a video where you show the on_dead and super._set_health(value) parts in more detail? at the moment they're returning errors in my script

    • @DashNothing
      @DashNothing  Рік тому +1

      No, I wanted to leave the health / damage / death implementation up to the viewer so the healthbar doesn't depend on it. Any way you approach doing health will work with the health bar.
      Here I used on_dead as a function defined in the parent Enemy script that can be overridden if needed. Also, var health is defined in the parent Enemy.gd so I call super._set_health() to trigger its setter first.

    • @ohhave3586
      @ohhave3586 Рік тому

      @@DashNothing thanks, is there any way you'd be willing to share your code for that section? I've just started game design and have found that putting together ideas from different videos/guides pretty tough.

    • @DashNothing
      @DashNothing  Рік тому +1

      @@ohhave3586 Here I made a gist with Enemy and BigGhost scripts:
      gist.github.com/DashNothing/2a0a54397826b4f3aaeb7d90d9f01c73

    • @ohhave3586
      @ohhave3586 Рік тому

      @@DashNothing That's awesome, thank you so much!

  • @RhevoRamirez
    @RhevoRamirez 2 місяці тому

    Thanks my friend

  • @hrothgarnogar
    @hrothgarnogar 5 місяців тому

    Really cool tut, and I followed perfectly fine until I got to 6:38. You just already have this function set up for _set_health but obviously I wouldn't and don't have a function like that already set up. So where would I add the "healthbar.health = health" statement???

    • @DashNothing
      @DashNothing  5 місяців тому +1

      @@hrothgarnogar You update the healthbar's health any time your enemy's health changes.
      In this case I have a var health on the enemy and a setter function _set_health which gets called every time you try to assign a new value to a variable. Here's a little example of setting up getters and setters: forum.godotengine.org/t/how-to-use-godot-4-setget/5975/2
      Of course, you don't have to update healthbar's health inside a setter function. You can also do it when the enemy gets hurt, wherever that might be in your code. It's up to you.

    • @hrothgarnogar
      @hrothgarnogar 5 місяців тому

      @@DashNothing Super helpful thank you!!!

  • @necrox7gaming186
    @necrox7gaming186 Рік тому +1

    i get the error: Attempt to call function 'init_health' in base 'null instance' on a null instance.

    • @DashNothing
      @DashNothing  Рік тому

      This means you didn't get the reference to the healthbar node in your enemy script. Either you didin't add the healthbar to the scene, didn't write the @onready var healthbar = $... line, or the name of your healthbar node and what you're trying to get in the @onready line don't match.
      Hope that helps!

    • @ponshop1742
      @ponshop1742 10 місяців тому +1

      @@DashNothing Month late, same issue as commenter above, but I've tried all of your fixes and it still is not working. Also says that health is not declared in the current scope but can that just be fixed by declaring health as a variable in the scene? I'm using it for my player character if that helps.

    • @DashNothing
      @DashNothing  10 місяців тому

      @@ponshop1742 Definitely add the health variable to your player script if that's where you're using the healthbar. Did you add the healthbar to the player scene? And did you use the instance scene button (chain icon)?

    • @ponshop1742
      @ponshop1742 10 місяців тому

      @@DashNothing Yep I've instanced the HealthBar scene into it, not sure why it isn't working

    • @DashNothing
      @DashNothing  10 місяців тому

      @@ponshop1742 The problem is your var healthbar is set to null because Godot couldn't find the healthbar in the scene. If the healthbar is in the scene also check if the spelling of the path to it is correct on the line @onready var healthbar = $...
      To make sure you can delete the path and just drag and drop the healthbar from the scene tree into the code editor. This will generate a correct path to it.

  • @ManuelAndreMusic
    @ManuelAndreMusic Місяць тому

    thank you so much for the great tutorial. one question. in _set_health() (4:46), why do you write health = min (max_value, new_health) instead of just saying health = new_health? Does it make any difference?

    • @DashNothing
      @DashNothing  Місяць тому +1

      @@ManuelAndreMusic Yes. The difference is you cannot set health above the max_value

    • @ManuelAndreMusic
      @ManuelAndreMusic Місяць тому

      @@DashNothing aaah thank you now I understand

    • @ManuelAndreMusic
      @ManuelAndreMusic Місяць тому

      @@DashNothing My personal challenge now is to implement a rally system with life regain - like in bloodborne

  • @saveriov.p.7725
    @saveriov.p.7725 6 місяців тому

    I really liek that knockback effect when the ghosts die from being shot. Would you be able to share how you did that?

  • @luthfiramadhan7116
    @luthfiramadhan7116 Рік тому

    thanks a lot g! this work very well on my code

  • @micahrobbins8353
    @micahrobbins8353 6 місяців тому

    I don't underatand what max_value is doing or why we need to use min() instead of just using new_health?
    Edit: ok I think I get it, the _init_health parameter is passed in from the enemy script's _ready function. That means that the init_health function is only called once to set the max_value once, meanwhile newHealth changes each time var health is updated.
    min(Max_value, new_health) prevents the value from exceeding whatever is initially define as the maximum health

  • @zakseven8422
    @zakseven8422 2 місяці тому

    Can anyone help me get hurtbox to work with lerp? I tried it myself but got an error, I'm a newbie and bad at coding, please help lol.

  • @Lutnar
    @Lutnar 5 місяців тому

    I'm getting null within init_health(_health) funtion in health bar and set_healthbar function getting null with damage_bar.value = health
    any ideas what I did wrong, I did exactly 1 to 1 from video

    • @DashNothing
      @DashNothing  5 місяців тому

      @@Lutnar You have to make sure yojr script has a _health var declared. For me this was in the parent Enemy script, so it's inherited. For you, you can declare right there at the top of the script.

    • @Lutnar
      @Lutnar 5 місяців тому

      @@DashNothing I added var _health = 0 in my texture bar script and for good measure in my player script like you said but its still giving me null at the same lines
      hit_bar.value = health
      and
      max_value = health

    • @Lutnar
      @Lutnar 5 місяців тому

      @@DashNothing its giving invalid set index "value" (on base : "nil" ) with value of type "float"
      in the line hit_bar.value = health and the same is in the script init_health with max_value and value

    • @Lutnar
      @Lutnar 5 місяців тому

      @@DashNothing overall sry for spamming in comments but it works then I instatiate as child of my player but not when I instatiate to the overall world and now my hp bar is following player bcs its child of it
      how can I do that it works without adding it as a child of a player ?

    • @DashNothing
      @DashNothing  5 місяців тому

      @@Lutnar Oh that's a different story. Did you get the reference to hit_bar with @onready at the top of the script? If you have that line, make sure that the path to the health bar node is correct.

  • @Wisdawms
    @Wisdawms Рік тому +1

    was waiting for you to use lerp or tween to smooth out that transition :(

    • @DashNothing
      @DashNothing  Рік тому +2

      I planned on doing it, but upon closer inspection a lot of fighting games don't even do that, so I decided against it. Easy to add though.

  • @WiredGamesOfficial
    @WiredGamesOfficial 11 місяців тому +1

    I followed every step to the detail and the bar never updates I've been at this for 3 days.....

    • @DashNothing
      @DashNothing  11 місяців тому

      One thing that comes to mind is if you're using health that's over 100 you have to change both progress bars' max value property in the inspector to be more than that. Put a value that you know is bigger than you will ever use. Since they are set to 100 by default, they will just not show any difference for values greater than that.

    • @physis6356
      @physis6356 5 місяців тому

      @@DashNothing omg this fixed my problem, thanks!

  • @rsutrainferno
    @rsutrainferno 8 місяців тому

    Does anyone know if this can be done with a texture progress bar?

  • @kissjudasg59
    @kissjudasg59 11 місяців тому

    Hello bro, I need to know how your game is set up in Godot. Is there a way to download it? I want to test your configurations.

  • @darkpalettegames009
    @darkpalettegames009 Рік тому

    nice video brother

  • @黄色的树枝
    @黄色的树枝 9 місяців тому

    Wow. exactly what i need

  • @DarknessSavior
    @DarknessSavior 10 місяців тому

    Is there a way to use this for the player's healthbar, and set up automatic health regen?

    • @DashNothing
      @DashNothing  10 місяців тому

      Yes, you'd do it similarly to how the enemies health works for damage. For regen you update the healthbar's health value in the same way. The bar will fill up without leaving any of the white underlying bar visible.
      Also, it can follow the player aor be static on the screen like a boss healthbar, no problem.

    • @DarknessSavior
      @DarknessSavior 10 місяців тому

      Could you give an example of how you'd code that?

    • @DashNothing
      @DashNothing  10 місяців тому

      @@DarknessSavior Maybe have a timer for the regen to kick off, and a var is_regenerating = false. Connect the regen timer timeout signal and set is_regenerating = true in the callback.
      In the _process() func check if is_regenerating and increase the health by a small amount, also updating the healthbar, as seen in the video. Check if health is already full, in which case set is_regenerating back to false.
      When the player takes damage you can call regen_timer.stop() to cancel any incoming regen, followed by regen_timer.start() to kick off a new attempt.
      This is just off the top of the dome piece. Try it and let me know how it went.
      Might make a video about this too.

  • @MH-lr6ue
    @MH-lr6ue 10 місяців тому

    I kinda made the health bar but I don't have anything to attach it too so it kinda doesn't work for me lol. I made the health bar deplete if I click my LMB but that's it lol. It doesn't even delete the health in a nice animated fashion lol. I still have lots of learning to do.

    • @DashNothing
      @DashNothing  10 місяців тому +1

      It's all a learning process. You'll get there bro

  • @TheRealKaiProton
    @TheRealKaiProton Рік тому

    that was a great Simply explained, Speedy video.
    the thumb nail showed the bar with a different shape, wider at the start and narrow at the end, can that be implemented?
    I know Godot can have circular bars, but never seen wider to narrow.

    • @DashNothing
      @DashNothing  Рік тому +1

      This can't be done by only using the ProgressBar node. You would need to somehow make a mask that hides the progress bar in the shape you want. You would probably use a shader to get the masking effect on top of a sprite of the shape you want. It seems there's no built in way to mask nodes in Godot.

    • @TheRealKaiProton
      @TheRealKaiProton Рік тому

      I bet shader is the way to go.

  • @nickyoung414
    @nickyoung414 10 місяців тому

    My health bar is initializing value and decreasing in value correctly but visually it doesn't change from the value set in the editor. How can I fix this?

    • @DashNothing
      @DashNothing  10 місяців тому +1

      This would happen if the progress bar's max value field in the editor is less than your health value. Max value by default is 100, so you won't see a change until your health goes below 100. You can go into the healthbar scene and crank up this max value to something huge that you know you're not gonna need to go over.

  • @Dlontong71
    @Dlontong71 6 місяців тому

    Help my health bar now lowering

  • @Flux0_0-u2d
    @Flux0_0-u2d 6 місяців тому

    thank you

  • @JimKrillPDX
    @JimKrillPDX 3 місяці тому

    If you are using a setter for "health" and then change "health" inside the setter, wouldn't that result in recurssion? That's what is happening for me.

    • @DashNothing
      @DashNothing  3 місяці тому

      @@JimKrillPDX No because in Godot you have to manually assign the value to the property inside the setter, otherwise it won't change

  • @dodomoko
    @dodomoko Рік тому

    Any recommendations to make the healthbar float on top of the enemy instead of being static at the bottom of the screen?

    • @DashNothing
      @DashNothing  Рік тому

      5:50 is where I show it in the video

    • @dodomoko
      @dodomoko Рік тому

      ​@@DashNothing I should have been more specific. I meant more in terms of if the enemy sprite changes (e.g., gets bigger or smaller) - how can you make sure the bar stays at the same relative height above the enemy

    • @DashNothing
      @DashNothing  Рік тому +1

      @@dodomoko If you put the sprite and the same healthbar under a common Node2D parent and then scale the parent instead, both will scale at the same time and remain proportional. This is the easiest solution, but the drawback is the proportions of the healthbar will not stay consistant with other healthbars (the border will be much thicker for example).
      Other solutions that come to mind:
      - animate the healthbar's position while you're animating the sprite scale (works only if you know the target scale in advance)
      - calculate the new healthbar position y by getting sprite.texture.get_size()..y * sprite.scale and set it in the process function or something
      Good luck bro!

  •  5 місяців тому

    Will this work also with TextureProgressBars? Or we need a different approach?

    • @DashNothing
      @DashNothing  5 місяців тому +2

      I haven't tried it, but I believe it will work the same.

    • @MB_Arssin
      @MB_Arssin 5 місяців тому +2

      @@DashNothing Yea it works, but in the parent node i just deleted "under" texture and left only progress one, then in DamageBar changed progress texture from normal to white and it works exacly the same. Thanks a lot. :P

  • @mateuszparus
    @mateuszparus 4 місяці тому

    Is it your mic picking up typing sound or some sort of software that adds it in post production? If it's the latter, what software is it?

  • @NDL19
    @NDL19 11 місяців тому

    Hey man, I'm making my own game, and that health bar is cming in really handy for me,(Thank you so much!) but I don't have any enemy Sprites, do you have a recommened sprite, or atleast the ghost you used in your video?

    • @DashNothing
      @DashNothing  11 місяців тому

      You can search itch.io for free sprite packs, there's a lot of stuff on there. I also recommend, as do many other gamedev youtubers, Kenney's assets - www.kenney.nl/

  • @Maddie240-h9b
    @Maddie240-h9b 11 місяців тому

    Awesome please explain how to make enemies in godot

  • @SamuTheFrog
    @SamuTheFrog 8 місяців тому

    "otherwise we are talking about"
    - DashNothing

  • @farrell3488
    @farrell3488 Місяць тому

    What is the health = 6 in function _ready():

    • @DashNothing
      @DashNothing  Місяць тому

      @@farrell3488 Setting up the initial health value

  • @TheOnlyGhxst
    @TheOnlyGhxst Рік тому

    Trying to figure out how to do this for a 3D game but sadly the same rules don't apply T_T

    • @DashNothing
      @DashNothing  Рік тому

      You can have UI elements in 3D space by using a viewport texture on a plane mesh. There are tutorials for it if you search for terms like "godot UI in 3D" or "godot viewport texture". Hope that helps!

  • @xx-ww9dk
    @xx-ww9dk 7 місяців тому +1

    Does this health bar work for player?

    • @DashNothing
      @DashNothing  7 місяців тому +2

      Yep, same principle regardless of what node uses it.

    • @xx-ww9dk
      @xx-ww9dk 7 місяців тому

      @@DashNothing thank you for answering

  • @Eliblack.
    @Eliblack. Рік тому

    look cool

  • @alphapesiesongs7102
    @alphapesiesongs7102 15 днів тому

    6:05
    I saw what you did there

  • @SinnaMon-s9p
    @SinnaMon-s9p 10 місяців тому

    is there a way to add this to a 3d scene?

    • @SinnaMon-s9p
      @SinnaMon-s9p 10 місяців тому

      update, nvm i just learned it overlaps the 3d scene, dont need an answer thanks!

  • @bluefox7628
    @bluefox7628 8 місяців тому

    "_set_health()" not found in base CharactedBody2D

    • @DashNothing
      @DashNothing  8 місяців тому

      It's a function we define ourselves to be the setter for the health variable.

    • @bluefox7628
      @bluefox7628 8 місяців тому

      @@DashNothing oh alright :))

  • @celsladroma8048
    @celsladroma8048 10 місяців тому +1

    why you so good at godot engine?

    • @DashNothing
      @DashNothing  10 місяців тому

      It's just practice. Making stuff. And I'm still learning with you with every video I make.

    • @celsladroma8048
      @celsladroma8048 10 місяців тому

      @@DashNothing will you doing it great... come on I'm just following you... and your channel is showing sign of good progress.. keep up the good work...

  • @MEMEBEAN6960
    @MEMEBEAN6960 11 місяців тому

    What is the on_dead = die

    • @DashNothing
      @DashNothing  11 місяців тому

      The enemy parent script has an on_dead callable which can optionally be assigned a function. Since the parent script takes care of deleting the scene when health reaches 0, it also calls on_dead first so any custom behaviour (like changing the sprite and emitting dust particles) which is defined in the child script, can happen first.

  • @ULTRADARKSETH
    @ULTRADARKSETH 4 місяці тому

    Again. Very helpful ! Really flexible . I would like to know your ideas behind the enemies super._set_health(value) if you don't mind.

    • @DashNothing
      @DashNothing  4 місяці тому +1

      @@ULTRADARKSETH Thank you!
      Every enemy inherits from the Enemy.gd script which has the var health and a setter function _set_health. When you use the keyword super you're calling something on the base script, in this case the Enemy.gd.
      So this sets the health to a new value. You can also define var health inside of each enemy's script if you don't have a lot of them, which would make this code slightly easier to follow. But having a base class for the Enemy is useful when you plan on having a lot of different ones that each use the same set of vars (like health).

  • @magasinmaytex7974
    @magasinmaytex7974 10 місяців тому

    Why does the Health Bar not change color?
    extends Area2D
    var pMeteorEffect := preload("res://Meteor/MeteorEffect.tscn")
    var minSpeed: float = 20
    var maxSpeed: float = 30
    var minRotationRate: float = -20
    var maxRotationRate: float = 20
    @onready var healthbar = $Healthbar
    var health: int = 20
    var speed: float = 0
    var rotationRate: float = 0
    var playerInArea: Player =null
    func _ready():
    healthbar.init_health(health)
    speed = randf_range(minSpeed, maxSpeed)
    rotationRate = randf_range(minRotationRate, maxRotationRate)

    func _process(delta):
    if playerInArea != null:
    playerInArea.damage(1)

    func _physics_process(delta):
    rotation_degrees += rotationRate * delta

    position.y += speed * delta
    func damage(amount: int):
    health -= amount
    if health

    • @DashNothing
      @DashNothing  10 місяців тому

      In the code you posted where exactly are you attempting to change color? I don't see it.

    • @magasinmaytex7974
      @magasinmaytex7974 10 місяців тому

      @@DashNothing
      Thanks, don't worry, I fixed it