All language subtitles for 21. Adding a healthbar

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Now we want some way to actually see what this damage is doing to our character.

So in the mobile game resources, you'll find a graphic health bar just going to add this to our canvas.

Just right click Jujuy and new image drag elfa into the source image and click certain ATSIC.

This one is not a rakas target because we don't need to interact with it.

But instead of its image type being simple, we're going to make this one filled image and to change

its fill method to horizontal.

And you'll now see that the full amount can be regulated.

I actually want it to go from the right instead.

OK, so it can go can do this and we can actually manipulate this in the code by using this fill amount

variable.

OK, first of all, I just need to position this somewhere on the screen.

So I'm going to choose the top.

Right.

And it's not an item that we need to click on.

However, I still recommend that you change type just to see where it is on all the different pieces.

As you can see there, it's basically been excluded.

Well, I want to make sure that it is targeted to the top right.

And then I simply just want to drag this over a little bit until it fits nicely in the corner.

We get that as close as I can to the corner and then that way on other systems.

It shouldn't be too far away from the edge.

Now, as you can see there on the Apple iPhone, and it's being cut off.

So I just need to check it on each of the devices.

Yeah, that's OK.

It's perfectly fine.

Feel free to go through absolutely every one of them, but I should imagine at the moment this is pretty

good.

It's a really long film.

Right.

OK, so it looks fine on all of them.

Great, I'll just go back to Samsung Galaxy J7.

That's that's one that kind of looks very generic.

Excellent.

OK, so let's change the name of this to help.

Whenever we want to access, for example, in the components that are on a UI element in the script,

we do need to tell it that we are accessing UI.

So if we go back into the main script right at the top, we do now need to say using unity engine dot

UI.

Not way I get access to that image, OK, so I'll just leave myself in another comment.

So health bar.

So this is going to be a public health type image for health bar.

In fact, it doesn't need the capital be there, so just one word health bar, OK, and then I need

some kind of a damage amount.

It's going to take place each time.

One of the animals hit me, it's me.

So I'll make that a public float.

Old damage amount's.

I'll probably make that about zero point zero five.

Now, it's right at the moment.

It does need an F on the end, and the actual fill amount only goes between zero and one.

So if you got a value greater than one, that will instantly be filled.

So when when you're talking about taking damage off there, it has to be a value less than zero zero.

If it's really small, so it's only going to take it off by increments.

And that's exactly what I want.

OK.

Which is why it's so small.

If you do all the different damage amount, let's say, for a ghost or a bat or a zombie, you could

create three different damage amounts if you want.

And where we have our update and we've seen if zombie attack is equal to true and we're simply going

to take it and the health bar off from here, so we're going to say healthcare, don't fill them out.

Minus equals damage amount.

That's it.

It's quite easy.

Let's do that also for the other ones.

Some control C, control V and control the OK.

And that will then start to take the alpha.

So some of the length of the health bar until it reaches zero.

OK, so we're going to see the player getting damaged.

Let's click on ground.

We do need to assign this image health bar.

Now we can try this out.

OK, so we don't let these creatures talk me.

There we go, can see the alsp really going down now.

Right.

These creatures are too far together.

And don't worry, we're going to be sorting that later.

Definitely the health bar is now going down.

And when it gets to zero, we actually want some kind of a game over.

You've sort of lost.

So to do that, I'm going to go all the way down to the bottom.

Well, I have the time delay, and I'm going to do instead of for enemies, I'm going to do check for

Gameover.

It's going to be a custom function, so I'll create that now just above for enemies may be able to avoid

check for came over.

OK, and all I'm going to say is if Health Healthpoint don't fill amount.

Is less than or equal to zero.

That's the case, and at the moment, all I'm going to do is basically display a message Debord debunked

log game over.

Later, we'll add some functionality so that you can basically be turned back to the menu.

OK, and that's how you get a health bar working in your game.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.