How to Make A Simple HEALTH SYSTEM in Unity

How to Make A Simple HEALTH SYSTEM in Unity

BMo

3 года назад

58,249 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@ASTARH
@ASTARH - 17.11.2023 02:10

hey i know im 2 years late but what is a health component

Ответить
@rahulvyas4020
@rahulvyas4020 - 08.09.2023 22:51

How would you do it if the death animation transition is in any state? And there is a parameter that Health If reaches zero, it should trigger the death animation? In a 3D game. I'm stuck at coding for health

Ответить
@DeathIsSelf
@DeathIsSelf - 21.08.2023 16:01

players current health does reset between playtests (and keeps last playtest value). but when the player get hit the value of currentHealth goes back to last playtest. any ideas?

Ответить
@animesongs3992
@animesongs3992 - 16.07.2023 02:07

im getting null refence error on collision

Ответить
@DoxX069
@DoxX069 - 05.06.2023 18:20

what is the healthComponent though

Ответить
@gerii4939
@gerii4939 - 29.04.2023 22:50

3 🍍

Ответить
@someonewithbadgrammer6740
@someonewithbadgrammer6740 - 01.03.2023 05:52

Can i get Farcry or Tarkov style healing system?
It would be really cool you know.

Ответить
@NoobNoob11037
@NoobNoob11037 - 14.02.2023 03:23

i typed out everything you did but it says that the comands i typed out are out dated. what do i do

Ответить
@ZotaEdits
@ZotaEdits - 25.12.2022 01:39

it doesnt show the max health and current health below the script even though i entered it properly

Ответить
@sansunnec
@sansunnec - 15.12.2022 00:07

had a streak for about 1 year... thy.
u lost!

Ответить
@GamingGables
@GamingGables - 01.09.2022 05:05

Not sure why, but my health bar goes down when I manually change my current health in the inspector. However, when using the OnTriggerEnter2D method the current health value still goes down, but the health bar image doesn’t actually change. Anyone know why this might be?

Ответить
@thediodoin1000
@thediodoin1000 - 01.08.2022 01:01

Thank you so much! this was the only tutorial video for health system that would work thank you for making this video it helped me so much and saved alot of tears

Ответить
@oedhelsetren
@oedhelsetren - 22.05.2022 22:25

Something I've tried is not creating add and subtract methods. All methods are additive, the values can be negative.

Ответить
@sajjadbaradaran6307
@sajjadbaradaran6307 - 22.02.2022 20:09

So I have a TakeDamage() function just like yours. At the moment I'm using this function to scale down my Fill (health bar UI image). I also have four different GameObjects, each with a Collider, and an OnMouseDown function which returns { this.Collider.isTrigger = true; }. Let's say that I want all four GameObjects to be clicked (in my case, since the game's a mobile game, touched) and after they're clicked, apply TakeDamage(). So I have created another script and attached it to an empty game object, and in it, I called all the GameObject.Colliders.isTrigger and put them in an If() statement like this:

public void FixedUpdate()
{
if(GameObject1.Colliders.isTrigger && GameObject2.Colliders.isTrigger ... == true)
{
TakeDamage(20);
}
}

but whenever I run the program, instead of reducing only 20 from health, and show currentHealth as 80, it completely reduces the currentHealth down to 0!

Basically, TakeDamage Works, if I'm using an If statement with a parameter of input.KeyDown function in Update, but if I use a bool in the If statment's parameter (like the example above), it doesn't work as it is supposed to.

Can you help me?

Ответить
@hologrammaster2468
@hologrammaster2468 - 19.02.2022 02:18

THANK YOU

Ответить
@Cleevor
@Cleevor - 23.01.2022 14:02

lol

Ответить
@akizuki2971
@akizuki2971 - 16.01.2022 16:37

just came here from watching a video on the same subject by a 250k sub channel..... yours was better by a large margin. You actually explained what you're doing and i appreciate that. Thanks!

Ответить
@ellaroselyn4909
@ellaroselyn4909 - 12.01.2022 20:36

My health bar doesn’t show up when i press play? I have a main menu too. Help?

Ответить
@GGFallenWarrior
@GGFallenWarrior - 18.12.2021 15:05

Can you make a video on how to make a stamina bar?

Ответить
@uncyan
@uncyan - 13.12.2021 06:41

your video is very Easy to understand

so I wish there were Korean subtitles. cuz im korean

Ответить
@andrewislastyear1118
@andrewislastyear1118 - 16.11.2021 03:50

Best prequel

Ответить
@LordBinzVR
@LordBinzVR - 06.11.2021 04:20

Simple and easy. Excellent tutorial!

Ответить
@dkordy
@dkordy - 13.10.2021 21:12

Great,but all of you with knowlege saying just like that,its simple like that or somthing...That word"JUST" It hurts,for complete beginers like me,nothing is not "JUST" NObody is born with knowlege... but compare to others you r sooo cool and i thank you for this tutorial...thanks

Ответить
@jappyproductions4429
@jappyproductions4429 - 28.09.2021 06:20

I get an error that says: ‘Health.TakeDamage(int)’ is inaccessible due to its protection level. Why is this?

Edit: I fixed this by changing the void takedamage to public

Ответить
@xioned
@xioned - 13.09.2021 20:39

That was so quick and awesone ACTUALLY ! I was looking for simple health system for so long and this showedup. :'''''') Thank you .You are a life saver.Good luck and bring us thanos just kidding.Bring us more videos like this <3

Ответить
@barghest8763
@barghest8763 - 17.07.2021 11:21

what extension did you use for untiy game on vscode?

Ответить
@wstevegaming593
@wstevegaming593 - 12.06.2021 02:25

Why do the arrows kill him if he's wearing full plate

Ответить
@blairmoore4424
@blairmoore4424 - 23.04.2021 02:10

Please do respawn

Ответить
@revmatch6r
@revmatch6r - 30.03.2021 03:37

Better hope I'm not around when you only have one pineapple left ⚰

Ответить
@EricYoungVFX
@EricYoungVFX - 29.03.2021 00:35

Your videos are so fast but so descriptive. You don't just use "code talk" you explain it in lamens terms. All the meanwhile, making the tutorials about 2-3x shorter than your average Brackeyes tutorial.
Keep it up, amazing videos! They help me a ton!

Ответить
@bigp0y
@bigp0y - 27.03.2021 17:01

What happened, Bmo? 3 pineapples max? Shame

Great vid btw

Ответить
@amandacollins7392
@amandacollins7392 - 27.03.2021 02:37

3 pineapples a day keeps the doctor away ;) I understand health now!

Ответить
@eileeng2492
@eileeng2492 - 27.03.2021 00:39

Great!
Examples so good!

Ответить
@lordkakabel76
@lordkakabel76 - 26.03.2021 18:55

I died... laughing! 😂

Ответить
@IceCream-sb7lc
@IceCream-sb7lc - 26.03.2021 18:22

That intro, I now want some pineapple.. and health care. More importantly pineapple though lol. Solid tutorial BMo!

Ответить
@deadbroadcastpc
@deadbroadcastpc - 26.03.2021 18:15

I like your explanation man, very entertaining

Ответить
@AdversaryOne
@AdversaryOne - 26.03.2021 17:59

Would there be a tweak in the script if I wanted a segmented health bar? Or would that all be done through the editor and art program (photoshop)?

Ответить
@lightningcode1136
@lightningcode1136 - 26.03.2021 17:48

Yes! I could not find this in a Brackeys tutorial

Ответить
@macaaris1018
@macaaris1018 - 26.03.2021 17:17

Pineapple 🍍😂 what an example 😂😂

Ответить
@Subwaye
@Subwaye - 26.03.2021 17:16

first

Ответить
@macaaris1018
@macaaris1018 - 26.03.2021 17:15

Great video 👍

Ответить