Unreal Engine 4 - Basic Health Bar

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ม.ค. 2025

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

  • @osiris5449
    @osiris5449 6 ปีที่แล้ว +7

    Easy, HD video, clear audio and overall great job. Subbed & notifications on.

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

    Switching from Unity to Unreal, thanks for the help Jackson!

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

    You should get more subs! That's why I love IT. There is tons of people sharing their knowledge to build humanity future

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

    Thank you! Turns out I was over complicating such a simple task!

  • @Nolanabbott13
    @Nolanabbott13 4 ปีที่แล้ว

    Thank you so much I was stuck on another tutorial and this really helped

  • @wyntermc2126
    @wyntermc2126 3 ปีที่แล้ว

    Thanks for the tutorial. Really straightforward.

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

    Note: With this, you can go past the max value by spamming F and spamming v won't change the health bar until you are less than the max health value. An easy way to prevent this is: Instead of V going to SET, drag V off and search "Branch". Connect V to that and then connect "True" from the Branch node to SET. In the Branch node, there is a "condition" dot in red. This is a boolean value. Next, get current health and get max health again. Right click in an empty space and type "

    • @chiaro2299
      @chiaro2299 5 ปีที่แล้ว

      Thanks, good advice!

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

      i know this is an old comment, but when i do that, the health bar doesn't change anymore at all

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

    FYI, if using Player Classes you have to "get player pawn" instead of "get player character" in the GetPercent graph

  • @Niroumeta
    @Niroumeta 5 ปีที่แล้ว

    Thanks a lot :D You are my hero!! I wanted to do a sanity bar and struggled for about 5 hours because none of the other 5 tutorials I tried seemed to work for me. I was starting to lose faith in humanity. And you explained everything properly too!!

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

    If you guys are having trouble having the health show up, my initial problem was both my current and max health variables were INTs (integers). I like keeping my health as integers, so BEFORE dividing, convert both to floats before feeding them into the division. (My previous logic was dividing both numbers as INTs first then converting that result into a float, which did not work and showed a grey bar regardless of the result). Hope this helps.

    • @Crimbtw
      @Crimbtw 3 ปีที่แล้ว

      why must it be floats, why cant i just use integers

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

      @@Crimbtw It may be possible to convert it to an integer somehow but it is much easier to use floats for most things... like health and mana and stamina i would use floats anyways just because i find it more definitive. for things like strength and dexterity i would use integers being they are more solid figures? to me anyways lol

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

    It worked great... But I wanted it to lose life when it went up on a platform, for example... and then I would have to do this blueprint there in the platform's event graph, right? So how to reference the third person's current healh value?

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

    I'm trying to make a clock, but it won't ever update the binded text. it just stays the same. am I doing something wrong?

  • @jeckgrimm7117
    @jeckgrimm7117 5 ปีที่แล้ว

    im realy love your tutorials.

  • @HappyGam3rs
    @HappyGam3rs 7 ปีที่แล้ว +6

    For some reason this isn't working on my AI's health bar widget, help please?

  • @tiehkaphloukxsb.157
    @tiehkaphloukxsb.157 2 ปีที่แล้ว

    Awesome your to the point. Thankyou so much for creating this channel insightful ; Im going to suggest that could you possibly or do you know how to fix a issue with the capsule character first person view stopping or slowly moving forward in the vector when rotating player view down if you can help at all it will be much appreciated 😁

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

    works for UE 4.27 perfectly thanx

  • @sprays4days-edits
    @sprays4days-edits 4 ปีที่แล้ว

    can you only have one event begin play in one eventgraph?

  • @TheEightshot
    @TheEightshot 8 ปีที่แล้ว

    At 5:54 what happens if you want to get something from something other than the player character?
    I'm attempting to create an inventory system and the inventory is contained within a separate blueprint (Currently using pawn class but this can be changed if needed) I need to get an integer from that BP to my widget. any advice? been struggling with this for a while now.

    • @titanicgames4785
      @titanicgames4785  8 ปีที่แล้ว

      It depends on how you have your inventory system set up. For example, if the inventory system is an actor component on the character, then you could simply get the component from the character reference in the HUD. If you can tell me how the blueprint is connected to the character/world that would help me give you a better answer :) We've got a discord too where you can post any questions you're having while developing if you'd like to join us discord.gg/ZDtMy5J

  • @tech-ii5sh
    @tech-ii5sh 5 ปีที่แล้ว

    Any idea how to get it to work when you do not have the Progress section in the HUD section? I find no place to add the values as you shown in your video. Using UE 4.21

  • @cvrucodex9542
    @cvrucodex9542 4 ปีที่แล้ว

    Great video subbed!

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

    how do i make it so when the health bar goes down to 0 it destroys the actor ?

    • @Fabian-ke9bq
      @Fabian-ke9bq 4 ปีที่แล้ว

      make a branch, take the current health and make an equal float then put the current health into the top float and type in 0 in the bottom float , from the branch connect true with the function "destroy actor" i hope i could help you :D

    • @aluckyshot
      @aluckyshot 4 ปีที่แล้ว

      Even cooler than just destroying the actual is set it up to rag doll at 0 health 🤣 don't get me wrong many time you will want it destroyed too so set a delay after rag doll and destroy after that.

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

    Thanks bro! nice tutorial :D

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

    how do i rotate it diagonally?

  • @GrumpyGameDev
    @GrumpyGameDev 6 ปีที่แล้ว

    Any new people having troubles, with the health not being clamped at 100 going above 100. Add a "clamp(float)" to your third person character then add x max value attach it to the end of the float + float then attach the return value on the "clamp(float)" to "set health current".

  • @_jacquey
    @_jacquey 4 ปีที่แล้ว

    Um, so how do I make it to actually show damage, not just work when I press buttons?

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

    I'm using First Person and my commands aren't the same, I don't even get the option to pick Get Current Health @5:59.

  • @wink3319
    @wink3319 7 ปีที่แล้ว

    I created a HUD as per your instructions. Instead of changing the "currenthelath" value by pressing keys, I defined a logic to run it down over time. The logic works in the sense that it reduces the value "Currenthealth" over time. At least that is what the debugger tells me. But the HUD is not updated. The bar remeinas full. When looking at the GetPercentage function in the HUD, this function is never called and the playercharacter is said to be out of scope. Any suggestions what went wrong? Thank you!

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

    Question, how can I make the health decrease as an AI touches my character/finishes following it?

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

      Try to find OnCollisionEvent (AI) and you do the thing he showed at the end of the video

  • @Necron1018Gaming
    @Necron1018Gaming 6 ปีที่แล้ว

    Very nice vid. Is there a way to have the healthbar update not on a tick? If you put a print string into the Binding's Graph, it'll print constantly. So, is there a way to have the update happen after damage is taken? Like having a "Cast To Healthbar" from let's say after you press "F" or "V" (add / subtract health).

  • @GordonSeal
    @GordonSeal 7 ปีที่แล้ว

    Thank you, this was really helpful !

  • @rijufrancispk4803
    @rijufrancispk4803 4 ปีที่แล้ว

    but both keypress events making my health bar goes down..(decreasing)..Anyone pls help..

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

    having a slight issue, when the current health is 0 the health bar is empty, but when the current health is any value other than 0 its full

  • @anthonykratos1006
    @anthonykratos1006 5 ปีที่แล้ว

    But how to make one connected to the character? Like the LOL/Dota/Clash of Clans?

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

    I know this is old video, but I have been trying this step by step, and every time my health bar is just empty white. Not really sure what is going on with it at this point. Triple checked that everything is the same. Any help would be greatly appreciated.

    • @toddietubby7450
      @toddietubby7450 6 ปีที่แล้ว

      is your current health and max health both set to 100?

    • @raifufufu9107
      @raifufufu9107 6 ปีที่แล้ว

      ty my brothers u saved me

  • @maxhope9686
    @maxhope9686 7 ปีที่แล้ว

    How do you do this for a split screen game

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

    hi, i followed every step, but when i press the key to decrease health, the progress bar becomes empty, what do you think?

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

      Fernando Baldrich hey, I had the exact same problem. make sure the result of the dividing between HP and Max HP is float from the start, I had in int and then when I changed it into float of course it would do nothing. so make sure HP and Max HP are both float and then divide them and put that result. hope this solves the problem

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

      Claudia Benko thanks, i figured that on my own but i still don't realise why, is it because integers cannot be divided?

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

      Fernando Baldrich no, that's not the problem, actually it is because integer/integer is still an integer, it's something that you learn very soon when you start learning C++. so if you had the max hp to 100 and the current hp to 100, the result of the divide between them would be 1. that means 100% so the bar is completely full. but, if your hp decreases even slightly - let's say you have 95 out of the 100 max hp, 95/100 in integer will be 0, not 0.95, so you will have 0%, an empty bar. that is why you should have the float variables divide, not the integer ones.

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

      Claudia Benko i didn't really learn c++ but i'm planning to. thanks for the reply!

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

      Fernando Baldrich go for it! good luck ^-^ and no problem, I myself struggled so I figured the least I could do is answer~ have a nice day ^^

  • @theridiculouschannel7017
    @theridiculouschannel7017 6 ปีที่แล้ว

    How would you animate the health bar when you increase/decrease health so it goes down slower instead of decreasing immediately?
    Thanks

    • @theridiculouschannel7017
      @theridiculouschannel7017 6 ปีที่แล้ว

      I don't know if I'm doing something wrong, but it appears that if I press the r key (which will increase my health) after my health bar is already full my current health will overflow the maximum health. Any ways to deal with that?

  • @deadlifestudios780
    @deadlifestudios780 6 ปีที่แล้ว

    Did you do the Assassin's Creed Health Bar ?

  • @MOKANN
    @MOKANN 5 ปีที่แล้ว

    #TitanicGames
    What should I do to prevent it from appearing on the main menu?

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

      There is a function called "Remove all widgets".
      I would call it when you open the menu.

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

    It only works once as in only takes out 10 points the first time I press, after that nothing happens.

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

    everything works so far for the character but I am using the same system for the enemy and for some reason when the game starts the health is at zero and nothing happens when the player hits the enemy but it works just fine when the enemy hits the player

  • @playdav485
    @playdav485 8 ปีที่แล้ว

    this is very helpful thank you

  • @zzumbagames
    @zzumbagames 6 ปีที่แล้ว

    my get life is appearing like sel in hud, why? And how do I get this?

  • @Cheezyfist
    @Cheezyfist 6 ปีที่แล้ว

    You can nolonger put the code add to viewport. I'm stuck

  • @pookipea5384
    @pookipea5384 4 ปีที่แล้ว

    thank you so much

  • @kaveebro4416
    @kaveebro4416 4 ปีที่แล้ว

    THIRD PEARSON BLUE PRINT
    WAHTS the meaning of f
    please help

  • @jiovannyzavala294
    @jiovannyzavala294 5 ปีที่แล้ว

    thanks for the tutorial, for some reason my keys do the opposite add instead of subtract and such so theirs a mistake on my end, still cool tho

  • @letheepirus2398
    @letheepirus2398 6 ปีที่แล้ว

    thank you, you helpful person

  • @walidalhusseini1174
    @walidalhusseini1174 5 ปีที่แล้ว

    for me it says [7078.57] Compile of HealthBar successful, but with 2 Warning(s) [in 307 ms] (/Game/HealthBar.HealthBar)
    can someone help

  • @baptiste_boo
    @baptiste_boo 5 ปีที่แล้ว

    I'm having a binding property error, fill colour and opacity :(

  • @hdgdoomknight592
    @hdgdoomknight592 8 ปีที่แล้ว +6

    It really won't display on my screen that my health is changing...

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

    very nice. can you have the stamina and health hud in one hud widget ?
    will the blueprints still work ?
    another quick question, is there a way so you can only apear a hud when the value of the bar is below 100% (health) just like skyrim ?
    good videos by the way! 😉

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

      Yes you can have health and stamina in one widget. Just setup the Stamina bar the same way as the health but with stamina related variables. And yes you can hide them when health or stamina is full. In the binding function, you can take the result of the division and check if it's >= 1 (meaning it's 100%) and then do a branch. Off the true, you'd take the ProgressBar_0 variable and SetVisibility to Hidden. Then do the return node and plug in the float like before. Off of false, you'd take the ProgressBar_0 variable and SetVisibility to Visible and then put the return node like before. I hope that helps!

    • @soley9797
      @soley9797 7 ปีที่แล้ว

      Titanic Games Thanks for the reply! i will have a go at this and get back to you. Thanks

    • @soley9797
      @soley9797 7 ปีที่แล้ว

      Sorry this did not work. How do I plug the return node like before ?
      The progress bar_o variable is that the function or just the actual progress bar ? Many thanks.

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

    Hey bro what about if that heathbar changes colour as it decreases.? like at:-
    100% health bar is green.
    60% health bar is yellow.
    40% health bar is orange.
    20% health bar is red.
    I am already a subscriber hope I will get notify soon about the above mentioned video. Thanks you in advance....

    • @NikoTheHawaiian
      @NikoTheHawaiian 4 ปีที่แล้ว

      th-cam.com/video/F9pWJZZxyk0/w-d-xo.html would be a good tutorial to check out

  • @gemesil
    @gemesil 6 ปีที่แล้ว

    I know this is old, but why float? you will never actually use those high numbers.

  • @shekiba.646
    @shekiba.646 6 ปีที่แล้ว

    there's no SET CURRENT heath.. I dont know. maybe its changed 2018

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

    thx

  • @logandoejogando...7532
    @logandoejogando...7532 6 ปีที่แล้ว

    I can use in the same hud, several bars ...

  • @klausbdl
    @klausbdl 7 ปีที่แล้ว

    thanks

  • @klausbdl
    @klausbdl 7 ปีที่แล้ว

    the dots are called vertex XD

  • @xavierturcotte7777
    @xavierturcotte7777 6 ปีที่แล้ว

    It doesn't work on 4.19.1

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

      It worked for me. are you still having issues? Maybe I can help.

  • @cloudy4806
    @cloudy4806 3 ปีที่แล้ว

    First Person?

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

    This channel will sink in a month LMAOO

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

      He stopped posting a year ago

  • @kristershomics3496
    @kristershomics3496 5 ปีที่แล้ว

    Bad tutoria.... Doesnt show up - get health and max

  • @DeathIsSelf
    @DeathIsSelf 8 ปีที่แล้ว +6

    nice job bro thank you

    • @MrSkullis
      @MrSkullis 6 ปีที่แล้ว

      yes you can it just creates a new tab for you to work on and you have to re graph your blueprints to that graph panel