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
@MattAspland3 жыл бұрын
@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
@corbinreginald28493 жыл бұрын
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
@blakebjorn13963 жыл бұрын
@Corbin Reginald instablaster =)
@corbinreginald28493 жыл бұрын
@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.
@corbinreginald28493 жыл бұрын
@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!
@TrojanLube694 жыл бұрын
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.
@tomazravljen89843 жыл бұрын
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)
@TrojanLube693 жыл бұрын
@@tomazravljen8984 Do you know how to work with arrays. Your reply is beyond beginner.
@tomazravljen89843 жыл бұрын
@@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...
@tomazravljen89843 жыл бұрын
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 ;)
@TrojanLube693 жыл бұрын
@@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_7074 жыл бұрын
Yeah wow, you've been so active with tutorials Awesome content!
@MattAspland4 жыл бұрын
Thank you so much! : D
@moeenghiyas919310 ай бұрын
I applied same successfully on UE 5.3; Thanks a lot.
@_jacquey3 жыл бұрын
This is interesting and the results look good on screen, but how do I actually make it show health? Like, damage, you know
@shakaama2 жыл бұрын
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.
@paulhill40674 жыл бұрын
Thank you! I followed another tutorial on this and it didn't work - but yours did!!
@MattAspland4 жыл бұрын
Glad I could help, thank you :)
@amelya93k4 жыл бұрын
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
@MattAspland4 жыл бұрын
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.9804 жыл бұрын
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 : )
@timurozer67094 жыл бұрын
Thanks a lot dude! Very simple and clear.
@MattAspland4 жыл бұрын
No problem! Glad you found it helpful :)
@arcticnerd59944 жыл бұрын
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.9804 жыл бұрын
You mean that the both AI share same health ?
@arcticnerd59944 жыл бұрын
@@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.9804 жыл бұрын
@@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
@pamparam34953 жыл бұрын
@@arcticnerd5994 Thank you guy! You're awesome
@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.
@pietpanzerpanzer53352 жыл бұрын
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 Жыл бұрын
thanks man, very usefull :)
@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-dojjo3 жыл бұрын
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)
@gtagam3r4 жыл бұрын
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.
@MattAspland4 жыл бұрын
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
@gtagam3r4 жыл бұрын
@@MattAspland Slowly my friend, make a good video, dont rush ;)
@MattAspland4 жыл бұрын
Thank you :)
@MattAspland4 жыл бұрын
Hi, that videos up, hope it helps and is what you were looking for :D
@gtagam3r4 жыл бұрын
@@MattAspland Yes i see it, but will try tomorrow, Thank you very much once again :)
@mouassimanesabdenour3 жыл бұрын
Thank you so much you always save me
@retrokainsle23723 жыл бұрын
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 Жыл бұрын
this is what I am looking for... How to oclude the widgets..
@jalsiddharth3 жыл бұрын
Question regarding your object reference. Can't you just do it with a reference to self?
@LeSchosch3 жыл бұрын
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.
@Voodookillers4 жыл бұрын
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.
@MattAspland4 жыл бұрын
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.
@Voodookillers4 жыл бұрын
@@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?
@MattAspland4 жыл бұрын
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
@VVLGANESHK3 жыл бұрын
@@Voodookillers Thanks bro.....this method work for me
@wimeradus3 жыл бұрын
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)
@_jacquey3 жыл бұрын
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?
@nowak933 жыл бұрын
You should really learn how to refrence when making games. Learn that before anything else would be my advice to you.
@bluethumbbuttoneek94653 жыл бұрын
@@nowak93 good job at being useless
@nowak933 жыл бұрын
@@bluethumbbuttoneek9465 Blueprint refrencing is exacly the solution to her problem. Stop being a dick
@guillaumepradier47573 жыл бұрын
@@nowak93 your still not giving an answer
@mugundhan06893 жыл бұрын
yeah ,I too have the same issue.Did you find any soultion?
@sadlucky14153 жыл бұрын
Thank you so much!!!
@el-fantasma213 жыл бұрын
Epic, Thanks bud! :)
@milan.9804 жыл бұрын
Thank you for this PS : No need to reply to this comment, if you dont have time
@MattAspland4 жыл бұрын
No problem, always happy to help! And I'll always try to reply to as many comments as I can :)
@clebo993 жыл бұрын
Weird that when I did this the widget wasn't being shown. Not sure what I did wrong.
@clebo993 жыл бұрын
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!!!!
@kaymonosara3 жыл бұрын
U r super intelligent!
@gamedevstanislove4 жыл бұрын
Cool) thank you for the video)
@MattAspland4 жыл бұрын
No problem, happy to help :)
@pranavravi24274 жыл бұрын
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.
@MattAspland4 жыл бұрын
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.
@pranavravi24274 жыл бұрын
@@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
@MattAspland4 жыл бұрын
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
@pranavravi24274 жыл бұрын
@@MattAspland cool :)
@milan.9804 жыл бұрын
@@pranavravi2427 malayali game dev ? COOL 🤗
@RandomDude000012 жыл бұрын
uhhhmmm leme try this the improved one didn't go very well with punching ai tutorial you make
@elbozomemeoriginals72963 жыл бұрын
how to make a ai have a health bar in our widget
@deantjewie2 жыл бұрын
Binding like that is terrible for performance, use event based UI