Show Health (Progress Bar) Above Widget | Floating Widget - Unreal Engine 4 Tutorial

  Рет қаралды 38,780

Matt Aspland

Matt Aspland

Күн бұрын

Пікірлер: 83
@MattAspland
@MattAspland 3 жыл бұрын
Hey guys, if you're not happy with the results of this video. I have done a new and improved video on this topic. I'd recommend watching that one instead of this one. Have a great day :) Updated and improved tutorial: kzbin.info/www/bejne/eKG3fIZrYp5-pKc
@MattAspland
@MattAspland 3 жыл бұрын
@moaz Z Hey mate, you can use a "sequence" node off of event begin play. "Then 0" goes into the code you have now, and "Then 1" into the new code. kzbin.info/www/bejne/jZi6gaCpf8mtiMU
@corbinreginald2849
@corbinreginald2849 3 жыл бұрын
Sorry to be offtopic but does anybody know a trick to get back into an instagram account? I stupidly lost the login password. I appreciate any assistance you can offer me
@blakebjorn1396
@blakebjorn1396 3 жыл бұрын
@Corbin Reginald instablaster =)
@corbinreginald2849
@corbinreginald2849 3 жыл бұрын
@Blake Bjorn I really appreciate your reply. I found the site on google and im waiting for the hacking stuff now. Seems to take quite some time so I will reply here later when my account password hopefully is recovered.
@corbinreginald2849
@corbinreginald2849 3 жыл бұрын
@Blake Bjorn it did the trick and I finally got access to my account again. I'm so happy! Thank you so much, you saved my ass!
@TrojanLube69
@TrojanLube69 4 жыл бұрын
When you are casting using arrays. Specially all actors of class, get the last idex to save as reference. For example. If you have multiple AI in the scene it will obtain the first AI health for everyone fixed. To solve it, all you need to do is get the length of the array and minus 1. Then use that object in last array index as your reference every time the widget is spawn in pawn/AI.
@tomazravljen8984
@tomazravljen8984 3 жыл бұрын
That wont do either if you have AIs that spawn on game start. They will all have a reference of the last actor enemy spawned (or first, didnt dig deep that far)
@TrojanLube69
@TrojanLube69 3 жыл бұрын
@@tomazravljen8984 Do you know how to work with arrays. Your reply is beyond beginner.
@tomazravljen8984
@tomazravljen8984 3 жыл бұрын
@@TrojanLube69 Lol, are you sure you are talking to the right guy? Maybe you misunderstood but I have clear understanding of arrays thanks :D Been working as a software developer for nearly 10 years now, not including education. I have a spawn point that spawned 3 actors, I had to use a different approach to set Enemy reference to the Widget, in order to always have the correct actor referenced. When all 3 were spawned this array index of course returned the same reference, even with length - 1 because they were already all added as actors. I used beginPlay on Enemy and passed itself to the Widget, the only PROPER way to do it. Doing via array is just hoping that you won't grab the wrong actor. Because with this array you get all of the from the level...
@tomazravljen8984
@tomazravljen8984 3 жыл бұрын
Plus there is no guarantee that the array is sorted based on creation date, or does documentation say that it is? But then again, you're hoping this gets called in the order you imaged which is not ideal. And my approach is way more performance efficient and it does not require looping through level actors ;)
@TrojanLube69
@TrojanLube69 3 жыл бұрын
@@tomazravljen8984 you wasted your money on education. Really, I’ve seen 1 year starting c++ developers tackle this problem with simple logic. It’s insane you cannot understand the simple solution. This might not be your carrer that will benefit you if you have spent 10 years of your life + 4 (assuming)of education and cannot tackle this simple problem. Insane! Goodbye
@antonio_707
@antonio_707 4 жыл бұрын
Yeah wow, you've been so active with tutorials Awesome content!
@MattAspland
@MattAspland 4 жыл бұрын
Thank you so much! : D
@moeenghiyas9193
@moeenghiyas9193 10 ай бұрын
I applied same successfully on UE 5.3; Thanks a lot.
@_jacquey
@_jacquey 3 жыл бұрын
This is interesting and the results look good on screen, but how do I actually make it show health? Like, damage, you know
@shakaama
@shakaama 2 жыл бұрын
3:20 you saved me 3 hours of trying to figure out what I did wrong on my project, why it wasn't going down on my battery.
@paulhill4067
@paulhill4067 4 жыл бұрын
Thank you! I followed another tutorial on this and it didn't work - but yours did!!
@MattAspland
@MattAspland 4 жыл бұрын
Glad I could help, thank you :)
@amelya93k
@amelya93k 4 жыл бұрын
Hello, i love your work. How do you go about lowering the enemy's health progress bar? my dummy dies after 4 hits, but the Health bar is 100/100 and does not drop
@MattAspland
@MattAspland 4 жыл бұрын
Hey, thank you :) And if you want them to take more hits before dying, you could decrease the amount of damage it is applying, or just increase their health. However, if you mean the progress bar isn't representing their health value, so it isn't changing, then I'd recommend double checking everything is the same as mine, and that you are actually linking the correct values and doing the maths correctly in the widget.
@milan.980
@milan.980 4 жыл бұрын
Ok, check the following : Go to enemy Blueprint The value of the enemy's health variable - set it to 100 If a certain condition happens, decrease health by 20 (any value under 100) If that is already done, then check removing the 'float / float' and directly connect enemy health to return value. Hope this helps : )
@timurozer6709
@timurozer6709 4 жыл бұрын
Thanks a lot dude! Very simple and clear.
@MattAspland
@MattAspland 4 жыл бұрын
No problem! Glad you found it helpful :)
@arcticnerd5994
@arcticnerd5994 4 жыл бұрын
This is great, exactly what I was looking for. I am just having some trouble getting it working for my specific application. The way you set it up seems to only work if I only spawn one AI_1 character. If I spawn 2 they both display the health value in the character at index 0. How would I go about setting up the references so that each widget references the specific character it's attached to? Maybe this question is a little beyond the scope of this video.
@milan.980
@milan.980 4 жыл бұрын
You mean that the both AI share same health ?
@arcticnerd5994
@arcticnerd5994 4 жыл бұрын
@@milan.980 Yeah, each AI displayed the health of the AI at index 0. I probably missed a step in your guide but I was able to fix it by setting a reference in the widget to the AI it was attached to. Casting from the AI character to the widget was a little weird. From the widget comment you have to use a "Get User Widget Object" function before you can cast. Then you can set the reference.
@milan.980
@milan.980 4 жыл бұрын
@@arcticnerd5994 get user widget ? I think I was looking for this piece of code for a long time XD Thanks for making this co-incidence happen
@pamparam3495
@pamparam3495 3 жыл бұрын
@@arcticnerd5994 Thank you guy! You're awesome
@IllGib
@IllGib Жыл бұрын
What if i wanna see a timer instead? I have a delay set after an event and just for testing i wanna see it, i tried to use the Duration instead of an Health variable but it doesn't refresh it stay filled.
@pietpanzerpanzer5335
@pietpanzerpanzer5335 2 жыл бұрын
Hi, my widget needs a refrence to the building it is located it, how do i set that in 3d widgets? The Problem is that i cant just cast to the Building and create a refrence because quite a lot of these buildings exist and quit a lot of these huds must be drawn
@markojotovic8991
@markojotovic8991 Жыл бұрын
thanks man, very usefull :)
@Glitchimations
@Glitchimations Жыл бұрын
can you add an event at certain point of the health bar? For example, 25% and below, it plays a different animation for the character
@g-dojjo
@g-dojjo 3 жыл бұрын
hello and thanks again bro im using this but if im spawn 5 monster in my project every monster share one hp bar :/ they dont have own hp bar X_X how can i solve this ? you have solution for this? aand thanks again :D (technically if im hit 1 monster all 5 monster's hp bar drop)
@gtagam3r
@gtagam3r 4 жыл бұрын
I will like your every video because your tutorial are best. And will promote your channel because i am popular youtuber and with this i can show you respect. P.s. can you do tutorial for Landscape auto material? I search for that, but alot of them are old or guys complicated things in their videos.
@MattAspland
@MattAspland 4 жыл бұрын
Oh wow thank you so much! That means a lot and is great to hear! : D I'm glad you find my content helpful, and thank you for liking and promoting, big thank you :) And I can definitely do a video on Landscape auto material, should hopefully be able to do it for tomorrow at 6PM GMT. Thank you again :D
@gtagam3r
@gtagam3r 4 жыл бұрын
@@MattAspland Slowly my friend, make a good video, dont rush ;)
@MattAspland
@MattAspland 4 жыл бұрын
Thank you :)
@MattAspland
@MattAspland 4 жыл бұрын
Hi, that videos up, hope it helps and is what you were looking for :D
@gtagam3r
@gtagam3r 4 жыл бұрын
@@MattAspland Yes i see it, but will try tomorrow, Thank you very much once again :)
@mouassimanesabdenour
@mouassimanesabdenour 3 жыл бұрын
Thank you so much you always save me
@retrokainsle2372
@retrokainsle2372 3 жыл бұрын
Unreal supports only world or screen space but i need symbiosis - widget should be affected by environment, i mean that I want widget to be partly hidden if there is a wall for example. Same idea as widgets in Lineage II ... How its possible ??
@DarkaniaWorks
@DarkaniaWorks Жыл бұрын
this is what I am looking for... How to oclude the widgets..
@jalsiddharth
@jalsiddharth 3 жыл бұрын
Question regarding your object reference. Can't you just do it with a reference to self?
@LeSchosch
@LeSchosch 3 жыл бұрын
hey great tutorial, could you do a similar one for VR? because I tried to replicate your tutorial in VR and it didn't work. guess it has something to do with the "Screen" option or so.
@Voodookillers
@Voodookillers 4 жыл бұрын
Cool thanks! Fore sure reason the color of the bar is black on my playtest while I asked it to be red. No idea why that is.
@MattAspland
@MattAspland 4 жыл бұрын
No problem, and hmm yeah that is strange, I'd double check the values in the colour and opacity, mainly the alpha, or "A", make sure it is 1.
@Voodookillers
@Voodookillers 4 жыл бұрын
@@MattAspland Thanks for the respons! I kid you not, it shows red on the designer but not on the play testing. The only way I got it to work, was to bind it to a fuction, and in the function i have a Set color and Opacity, with the exact same values as in the designer... then it works. I am using the topdownexample from Epic, but I don't think that will make the difference?
@MattAspland
@MattAspland 4 жыл бұрын
Oh great right okay, I guess if it works it works lol, But yeah that shouldn't make a difference at all, I guess you just need to set the colour in opacity in the bind for it to work
@VVLGANESHK
@VVLGANESHK 3 жыл бұрын
@@Voodookillers Thanks bro.....this method work for me
@wimeradus
@wimeradus 3 жыл бұрын
And if the character dies, then the reference gets broken, and the UI doesn’t work anymore. Whats a proper way to fix this? How to refresh the player reference in the UI? (In multiplayer)
@_jacquey
@_jacquey 3 жыл бұрын
Alright, I managed to make it show health but I discovered a huge problem. The same AI controls all characters and when one gets hurt, everybody's health goes down! Do you have any idea how to fix that?
@nowak93
@nowak93 3 жыл бұрын
You should really learn how to refrence when making games. Learn that before anything else would be my advice to you.
@bluethumbbuttoneek9465
@bluethumbbuttoneek9465 3 жыл бұрын
@@nowak93 good job at being useless
@nowak93
@nowak93 3 жыл бұрын
@@bluethumbbuttoneek9465 Blueprint refrencing is exacly the solution to her problem. Stop being a dick
@guillaumepradier4757
@guillaumepradier4757 3 жыл бұрын
@@nowak93 your still not giving an answer
@mugundhan0689
@mugundhan0689 3 жыл бұрын
yeah ,I too have the same issue.Did you find any soultion?
@sadlucky1415
@sadlucky1415 3 жыл бұрын
Thank you so much!!!
@el-fantasma21
@el-fantasma21 3 жыл бұрын
Epic, Thanks bud! :)
@milan.980
@milan.980 4 жыл бұрын
Thank you for this PS : No need to reply to this comment, if you dont have time
@MattAspland
@MattAspland 4 жыл бұрын
No problem, always happy to help! And I'll always try to reply to as many comments as I can :)
@clebo99
@clebo99 3 жыл бұрын
Weird that when I did this the widget wasn't being shown. Not sure what I did wrong.
@clebo99
@clebo99 3 жыл бұрын
Scratch that!!! I got it to work. Just needed to adjust. Works like a champ. I already had a Health system applied to my NPCs so it is working well. Thanks so much!!!!
@kaymonosara
@kaymonosara 3 жыл бұрын
U r super intelligent!
@gamedevstanislove
@gamedevstanislove 4 жыл бұрын
Cool) thank you for the video)
@MattAspland
@MattAspland 4 жыл бұрын
No problem, happy to help :)
@pranavravi2427
@pranavravi2427 4 жыл бұрын
if you put that character in a map like pubg's, you will be able to see that health bar from miles away. Because you can see it behind objects too.
@MattAspland
@MattAspland 4 жыл бұрын
Hi, yes you are correct, however to fix this you could put a box collision around the enemy, and on begin overlap with your player, set the UI to be visible, and on end overlap, set it's visibility to be false again. Also, set it to be not visible by default. Hope this helps.
@pranavravi2427
@pranavravi2427 4 жыл бұрын
@@MattAspland if the enemy is far away, it might be a problem. For open world shooting games, it's very expensive to put a box collision that big for every enemy character. I was thinking about making it visible in every bullet hit in the character body and setting a timer for 2 or 3 seconds to turn it to hidden
@MattAspland
@MattAspland 4 жыл бұрын
Ah yeah that would be a better way of doing it, I was just thinking about close quarters combat, but yeah for an open world shooting game that would be very much more efficient
@pranavravi2427
@pranavravi2427 4 жыл бұрын
@@MattAspland cool :)
@milan.980
@milan.980 4 жыл бұрын
@@pranavravi2427 malayali game dev ? COOL 🤗
@RandomDude00001
@RandomDude00001 2 жыл бұрын
uhhhmmm leme try this the improved one didn't go very well with punching ai tutorial you make
@elbozomemeoriginals7296
@elbozomemeoriginals7296 3 жыл бұрын
how to make a ai have a health bar in our widget
@deantjewie
@deantjewie 2 жыл бұрын
Binding like that is terrible for performance, use event based UI
@deivid-01
@deivid-01 Жыл бұрын
Thanks a lot !
How To Add 3D Meshes to Images in Widgets
16:08
Just Another Dang How To Channel
Рет қаралды 9 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
How To Make A Health Bar In Unreal Engine 5
15:19
Matt Aspland
Рет қаралды 85 М.
Unreal Engine - Damageable Health Bar Tutorial (1/2)
26:42
Reids Channel
Рет қаралды 25 М.
Why Unreal Engine 5.5 is a BIG Deal
12:11
Unreal Sensei
Рет қаралды 1,5 МЛН
WTF is? The best thing to use?
13:45
Mathew Wadstein Tutorials
Рет қаралды 15 М.
Round / Radial Progress Bar - Unreal Engine 5 Tutorial [UE5]
12:39
Speed Level Art - Fantasy Scene - Unreal Engine 4
10:00
Stephane Charre
Рет қаралды 221 М.
I Made a Battle Royale Game in Unreal Engine 4
11:17
Fat Dino
Рет қаралды 1,2 МЛН
Unreal Engine 4 - Creating a Health Bar and Health Regen
11:17
Good Pie Tutorials
Рет қаралды 51 М.
Unreal Engine 4 - Sprinting and Stamina Bar (Part 1)
14:00
Titanic Games
Рет қаралды 35 М.
Unity VS Unreal Engine in 2021 | What is the best Game Engine?
29:39
Brendan Dickinson
Рет қаралды 264 М.