How To Make A Health Bar In Unreal Engine 5

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ย. 2024

ความคิดเห็น • 94

  • @skol45
    @skol45 ปีที่แล้ว +5

    I cant choose a target for the Set Health node.. is there a reason ? its at 13:00
    its always just a normal set health node without a Target

  • @melonadegg
    @melonadegg ปีที่แล้ว +18

    Mate, you're like the Brackeys of Unreal Engine. Keep up the great work!

  • @wolfiedgr8t
    @wolfiedgr8t 2 ปีที่แล้ว +2

    Thanks MAtt, yes please to damage system, maybe you could use and enemy ai to shoot the character so he takes different (or random) amounts of damage each hit.

  • @kup_guitarplayer
    @kup_guitarplayer ปีที่แล้ว

    Matt, you're risking: either create an image with a "PO2" rule (for correct mip-mapping), or use a "Compression Settings -> UserInterface2D" and "Texture Group -> UI" in the image details panel.
    Otherwise, you'll have non-smooth and kinda distorted image.

  • @Archill
    @Archill 10 หลายเดือนก่อน +3

    I have a start menu and the health bar shows up in the main menu as well, how do I hide it in the menu and make it appear when in the actual game?

    • @dondahighhh12
      @dondahighhh12 7 หลายเดือนก่อน

      if you didnt fix it yet, you have to change the visibility of the UMG elements

  • @brucemozart3665
    @brucemozart3665 2 หลายเดือนก่อน

    Great tutorial. Thanks!

  • @chris09423
    @chris09423 13 วันที่ผ่านมา

    Mine doesn't have size x or size Y to adjust the picture. It has Offet top, Offset right, ect. I am using 5.4

  • @FredbonFilms
    @FredbonFilms 2 ปีที่แล้ว +1

    TYSM MATT!! LEGEND!

  • @techno2776
    @techno2776 2 ปีที่แล้ว +3

    Hello, is this meant for UE 5.0.1? There is a BIG problem: The method at 9:17 is not working anymore. Am I the only one with this problem?? "Get health/Get Max Health" is not working because there is no more single-float available. It´s now Float(double-precision). It´s definetely not working. My same project in UE4.27 has a Float without "double-precision" and now in UE5 it´s not working. Is there a way to change it back to simple-float? I am searching since hours. Someone said the newest version fixed it but I have the newest version (5.0.1) and no update is shown in UE-Launcher. Did I miss something?

    • @NoixNuts
      @NoixNuts 2 ปีที่แล้ว +2

      How do i resolve this please?

    • @mootzartdev
      @mootzartdev 2 ปีที่แล้ว +2

      Didn't work for me either.

    • @techno2776
      @techno2776 2 ปีที่แล้ว +1

      I still have the problem and I don't understand why so many don't have the problem. If every UE5 version only has double-precision float, how does everyone else do it? So I think the fault must be my own. On the other hand, nobody would be able to do it like in the video.

  • @hashimshah7732
    @hashimshah7732 7 หลายเดือนก่อน

    Will you please make a healing system where when i pick up the health it will show in my inventory and there i can use my health anytime

  • @PRiMezGFX
    @PRiMezGFX 2 ปีที่แล้ว +2

    Hi Matt, just curious but what are the main benefits for coding the health bar this way compared to what you previously did within UE4? I understand optimization is a major benefit but is there anything else? Thanks

    • @MattAspland
      @MattAspland  2 ปีที่แล้ว +1

      Hi mate, it is predominantly just for optimisation purposes. However, some people may find this easier to manage and keep on top of when managing the player's health. It can also make it easier to adapt this to multiple players, instead of just the one. Hope this helps :)

    • @PRiMezGFX
      @PRiMezGFX 2 ปีที่แล้ว

      @@MattAspland Great! thanks for the quick reply. I really appreciate it :)

  • @carlosrivadulla8903
    @carlosrivadulla8903 2 ปีที่แล้ว +1

    U should try event dispatchers for widget comunication

    • @offirbaruch7895
      @offirbaruch7895 ปีที่แล้ว

      Agreed. Using binding like is called out on every frame making this method (though easy to implement) really bad for performance.

  • @MartKart8
    @MartKart8 2 ปีที่แล้ว

    I have a health bar, but I want to have a different one, the health bar is hearts and work perfectly, Oh I used that Niagara the one you showed off in your latest video for free for the month assets (picks Heart) and used you campfire tutorial you did and my character gains health back.
    I like the idea of using a Wheel health bar instead like the one in Super Mario Odyssey.

  • @LegendJ0e4
    @LegendJ0e4 2 หลายเดือนก่อน

    did you ever make the proper damaging system video? i need that so badly for enemys to attack me

  • @adiltonaeon
    @adiltonaeon 2 ปีที่แล้ว

    You should use a Matt specific custom character in your tutorials, to make it feel extra high quality, in my opinion; of course.

    • @wesss9353
      @wesss9353 2 ปีที่แล้ว +1

      I'd like him to use the same character each tutorial.
      A shooter guy for shooty games
      A melee build for fighting
      And an generic character

  • @bamfyu
    @bamfyu ปีที่แล้ว

    Thanks a lot, this works well.

  • @galberger3937
    @galberger3937 ปีที่แล้ว

    Hi.
    Can you show how to add a you are dead menu with the options to play again or to quit the game?
    Can you also show how to create a healthbar when the player get damage the colors will change from green to yellow to red and when the player will find a pickup health item the health bar will increase with those colors?

  • @unsupporteddevice
    @unsupporteddevice ปีที่แล้ว

    whenever i promote the "create healthbar widget" to a variable it doesn't become a widget one like yours ( 12:30 ). I don't know what I'm doing wrong

  • @Error-js7dp
    @Error-js7dp ปีที่แล้ว +1

    5:25 opacity not color

  • @Broockle
    @Broockle 6 หลายเดือนก่อน

    awesome thx ^^

  • @artdrawing6682
    @artdrawing6682 ปีที่แล้ว

    mat thank you you fix my big problem i folow totorial respawn player and what hapend next my player if daying helth not updait i out from game and teke error more orror end finly fixed please kip going you are the best her

  • @samizo5842
    @samizo5842 2 ปีที่แล้ว +3

    Yeah we want a proper damage and healing system

  • @endvfxgamingraidingcg7293
    @endvfxgamingraidingcg7293 ปีที่แล้ว

    NICE!!!

  • @mr.morningstarplays3188
    @mr.morningstarplays3188 ปีที่แล้ว +1

    when I hit deal damage all 100percent hp goes down and not just 10 percent. in apply damage I tried base damage 1 , 10, 0,1 , 0.01 but it has the same result does somebody have same error?

    • @mr.morningstarplays3188
      @mr.morningstarplays3188 ปีที่แล้ว +1

      And 1 minute later I notice that right after event any damage the - box, I put helth in the botom and damage on the upper and that was the problem

    • @mr.morningstarplays3188
      @mr.morningstarplays3188 ปีที่แล้ว +1

      solution to put connect helth upper and damage to bottom conection in - box

    • @mr.morningstarplays3188
      @mr.morningstarplays3188 ปีที่แล้ว +1

      solution to put connect helth upper and damage to bottom conection in - box

    • @MaksymKyrychenko-dd9vg
      @MaksymKyrychenko-dd9vg ปีที่แล้ว

      tnx,its help me

  • @Wc3Tutorials
    @Wc3Tutorials 2 ปีที่แล้ว

    please add a shield system and the damage system. For a upcoming tutorial

    • @silverblank1139
      @silverblank1139 2 ปีที่แล้ว

      i'd rather see a damage an armor reduction system, shield is easy to copy

  • @ibrahimrezaee5342
    @ibrahimrezaee5342 7 หลายเดือนก่อน

    thanks a lot

  • @Aikanarokun
    @Aikanarokun ปีที่แล้ว

    My progress bar fills the whole screen when I play.

  • @mushanwu3969
    @mushanwu3969 2 ปีที่แล้ว

    Why doesn't my ue5 have a health node😥

  • @patrickmiller1723
    @patrickmiller1723 2 ปีที่แล้ว

    please make a damage and healing system

  • @MaksymKyrychenko-dd9vg
    @MaksymKyrychenko-dd9vg ปีที่แล้ว

    i cant connect hp bar to set variable like on 12:50 . Why its happening?

  • @lilithtch
    @lilithtch ปีที่แล้ว

    i messed up my codes and i didn't know what to do i was getting an error from somewhere and it was restarting my game i was about to go crazy after reviewing the whole game it was because of the goddamn health bar

  • @ZimMabu_GameDev.
    @ZimMabu_GameDev. 10 หลายเดือนก่อน

    Thankya bra

  • @baryafe
    @baryafe 5 หลายเดือนก่อน

    i want dmg and healing

  • @liamhiggins9965
    @liamhiggins9965 ปีที่แล้ว +2

    My Health Bar doesn`t reset after dying... what am I doing wrong?

    • @lordbambithird8919
      @lordbambithird8919 10 หลายเดือนก่อน +1

      Might be a bit late but you would want to reset it when you destroy actor, or whatever event you use as "death"

    • @liamhiggins9965
      @liamhiggins9965 10 หลายเดือนก่อน

      @@lordbambithird8919 cheers man, but how exactly?

    • @lordbambithird8919
      @lordbambithird8919 10 หลายเดือนก่อน

      @@liamhiggins9965 just on the line that you destroy actor set the variable to its maximum.
      Use the set function to set the variable to 100 if its a healthbar of 100 health or if your healthbar changes due to ingame factors use that to set a variable called maximum health.

  • @denberz711
    @denberz711 หลายเดือนก่อน

    Good at showing. Bad at telling.

  • @azaelue5
    @azaelue5 2 ปีที่แล้ว +2

    Seen and seen again... Make some original content pleeease

  • @grembenlin1903
    @grembenlin1903 11 หลายเดือนก่อน

    im having an issue where to progress wont go down on screen everything else works, when pressing 1 10 times and goes to 0 something happens but the progress wont go down when pressing 1

    • @grembenlin1903
      @grembenlin1903 11 หลายเดือนก่อน +1

      i got it to work, i basically got rid of the the event construct part and pasted it on the get percent so on get percent node cast to player character, get player character then on as player character, get health, then divide, add the max health(or 100) then return node, ive had no bugs or errors pop up with this, this is using the efficient method, i didnt need the character reference

  • @deeznutts8073
    @deeznutts8073 ปีที่แล้ว

    nice

  • @kashootme7722
    @kashootme7722 ปีที่แล้ว

    bloody annoying how long this took and then my mte showed me a easier way in under a minuet, could of been alot quicker/shorter to save our time!!!!

  • @charzxd6515
    @charzxd6515 2 ปีที่แล้ว +12

    for multiplayer, you can use the cast and reference on the event pre construct, it ensures it has enough time to initiate and will be perfectly synced to the servers game, but construct is fine too

  • @joshmurphy6763
    @joshmurphy6763 2 ปีที่แล้ว +3

    Thanks for the tutorial dude, been getting to know ue for the first time and your videos are really helping! I just have one issue with my code, i think i may have left something un ticked but when i start the game the red in the health bar doesn't show until health is gained or damage is taken, do you know what may be wrong? Thanks again!:)

  • @whitecomet98
    @whitecomet98 2 ปีที่แล้ว +5

    this is seriously the best tutorial for this available, thank you

  • @casualsamuli
    @casualsamuli 11 หลายเดือนก่อน +2

    Great video! Only hard part was doing the damage since you first put "add"-node and then switched it to "subtract". I missed it like 20 times but finally got it right. Thank you!

  • @virgilhawkins3390
    @virgilhawkins3390 2 ปีที่แล้ว +3

    Good tutorial! Straight and to the point. The only part I had to rewind on a bunch of times is when you were fiddling with the widget reference and setting the health values in there. It was really hard to see where all the blue return value lines were going at any given time.
    In future videos, could you pin the lines away from one another so each connection is distinct? Thanks!

  • @brighthammer5354
    @brighthammer5354 2 ปีที่แล้ว +4

    Seen and seen again. I love all ur videos. thank you matt. I want to see the system of damaging and healing.

    • @chadkruger
      @chadkruger 2 ปีที่แล้ว +1

      If you have the health bar working, damage and healing are easy. It's just adding and subtracting of the health variable.

    • @brighthammer5354
      @brighthammer5354 2 ปีที่แล้ว +1

      @@chadkruger I tried to use apply damage but the problem is in the damage. It always get critical hit. in this case I set the health 475 instead of 100. so that's why I want to see the damaging system.thx for help mate. I hope u always be fine🙂👍🏻

  • @corrohsivegaming7077
    @corrohsivegaming7077 9 หลายเดือนก่อน +3

    first one that has worked for me without needing a whole other tutorial series. thanks

  • @deadreadygames
    @deadreadygames 2 ปีที่แล้ว +3

    Once again...well done, Matt! Yet another quick and easy implementation of an otherwise overwhelming concept, made simple and scalable for any progress bar type features. Hope you have an amazing holiday and return to us safely at max health. Cheers!!

    • @MattAspland
      @MattAspland  2 ปีที่แล้ว +1

      Thank you so much for your support, super happy to help out!

    • @MaxStudioCG2023
      @MaxStudioCG2023 ปีที่แล้ว

      @@MattAspland hey man ...the health system working perfectly but i try to make it on top of the enemy head ...all good is taking the damage and all but the health bar is not updating (the line not droping when enemy get the damage) .....done all exactly like il do to the character ..i dont know why not updating the bar itself

  • @KarolDecyk
    @KarolDecyk 6 หลายเดือนก่อน +1

    my progress bar is showing empty life even i set it on 75%

    • @julsius
      @julsius 17 วันที่ผ่านมา

      mines currently doing that too.
      it shows fine on the visual designer and the bar loads in game but with zero health despite defaulted to 75.
      lots of errors on the getter:
      Blueprint Runtime Error: "Accessed None trying to read property CharRef". Node: Return Node Graph: GetPercent Function: Get Percent Blueprint: HealthWidget
      seems to be the root of the problem for me. but havent worked out how to fix it yet

    • @julsius
      @julsius 17 วันที่ผ่านมา

      fixed it. the var wasnt promoted properly so it wasnt finding the reference

  • @xXBrutus67Xx
    @xXBrutus67Xx 2 ปีที่แล้ว +2

    Hi, first thank you for all the videos, they are well explained ! I do have one question though.
    So i did this exercise again, i created the Health widget blueprint with the two health variables and promoted it to a variable in the player's blueprint, but i cannot access the widget variables from there, any idea why ?
    Like this: BeginPlay - Create Health_W widget - SET Health_W - (cannot access its variables) - Add to viewport
    EDIT : for those who wondered, in the widget blueprint, in the Divide node, you have to promote the green connectors to variables. You can then access them from another blueprint. I originally created the health variables in the left panel which isn't the right thing to do.

    • @virronenfin
      @virronenfin 2 ปีที่แล้ว

      I have the same problem. I cannot to find event "begin play"

    • @skol45
      @skol45 ปีที่แล้ว

      o god thanks! im about to always set them each time no matter what haha... i always forget this and search for answers -.-.-.-.-
      its still a dumb procedure in ue5 imo.. though - i think you can just go into details of the variable you created and then check "Instance editable", youll get access then too

  • @robpenfold9500
    @robpenfold9500 ปีที่แล้ว +1

    Is there any way to make the health go up 1 value at a time? Rather than just snapping to the new value?

  • @jacktomlinson215
    @jacktomlinson215 2 ปีที่แล้ว +1

    good Job mate

  • @redwolf831
    @redwolf831 2 ปีที่แล้ว +1

    How can you make it fade away when it is full like in destiny 2

    • @gorgefompson4265
      @gorgefompson4265 2 ปีที่แล้ว +1

      within the player on event tick add a delay for every 5 seconds, then a branch to see if health is equal to whatever your maximum amount is, then if it is equal to max take a reference to the HUD and remove from parent, then on event any damage, take the same HUD reference and add it to viewport.

  • @lespaul1507
    @lespaul1507 9 หลายเดือนก่อน

    Thanks for the tutorials ive learned a lot. But now i have my health bar on my main menu. How can i remove it from the menu?

  • @FPChris
    @FPChris ปีที่แล้ว

    How do you just a single 1 pixel thick black outline to the progress bar?

  • @JoseManuelRodenes
    @JoseManuelRodenes 2 ปีที่แล้ว

    Excellent video, would it be very difficult to combine the health system with a specific number of lives? That is, for example, 3 lives and when the number of lives runs out, you start again on the game start screen or on the game over screen. Excuse my English, i dont speek English, google translator, srry and THX!!...

  • @thenerdydevguy8454
    @thenerdydevguy8454 2 ปีที่แล้ว +3

    hi Matt, I am a big fan of your work, but can you please make a tutorial on how to make guns, with different stats, such as recoil and bloom?

  • @buennyo
    @buennyo 2 ปีที่แล้ว

    Thank you so much for your help! Ca you make a health bar like in FPS games so numbers not a graphic?

  • @ssneakyandfriends1626
    @ssneakyandfriends1626 ปีที่แล้ว

    this also coincidentally enough, also works for other bars.

  • @abos9118
    @abos9118 2 ปีที่แล้ว

    How can I make health and stamina together when I made it it has proplem

  • @K0UK0U
    @K0UK0U ปีที่แล้ว

    Thnx for this video !

  • @evolve9922
    @evolve9922 ปีที่แล้ว

    Thx, thats realy helps me

  • @Gam3inGpR0Zz
    @Gam3inGpR0Zz 2 ปีที่แล้ว

    Yes another vid!!!!

  • @ZeeroCool1979
    @ZeeroCool1979 2 ปีที่แล้ว

    Another great video thanks a lot!

  • @LegendJ0e4
    @LegendJ0e4 2 หลายเดือนก่อน

    My character is taking damage even when far away or the damaging enemy is dead. what do i do..?

  • @jakzak23
    @jakzak23 ปีที่แล้ว

    I cannot make it work, although I do whatever you say.