How to make a Mana Bar in the UI (Unity Tutorial for Beginners)

How to make a Mana Bar in the UI (Unity Tutorial for Beginners)

Code Monkey

5 лет назад

76,136 Просмотров

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


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

Code Monkey
Code Monkey - 20.02.2019 21:14

Did you know about the RawImage component? What interesting things have you done with it?

Ответить
MGLR
MGLR - 22.12.2022 01:40

I have a question. If this were to be called using a button on the keyboard (new input system), how could we stop it from repeating every frame?

Ответить
dani
dani - 30.08.2022 11:45

Hello,if i have my own UI(not the one from your code) how can i make it when click that button spend mana?

Ответить
North Strider
North Strider - 25.05.2022 12:21

So the sizeDelta approach doesn't seem to be working anymore despite setting the achors to the left. It just starts resizing from the center instead so it's being squeezed instead of filled from the left.
Edit: you gotta set the pivot point to 0 0 to make it work.

Ответить
DBZ
DBZ - 14.01.2022 20:38

I have a doubt sir. In my game, I am having a shooting bar. Which means , If I hold the shoot button, then the shooting bar gets decreased and if the bar is at 0 then the player should stop shooting. And the shooting bar regenerates. Problem is if I press the shoot button it is decreasing but it is not stopping to shoot. It is continuously shooting after bar is at 0 while holding the button. And I solved this problem by using setactive. But after that, another problem came, that is, if I press the button, it is not shooting after the bar is 0, yeah that's fine, but the bullets are only disabled, so it is creating many disabled bullets in hierarchy. What should I do sir plz 😥😥

Ответить
ItsDamu
ItsDamu - 13.11.2021 05:59

Now how would I spend mana from my Skills script? im using the old Input system with a simple use skill on key press.

Ответить
YesilElma
YesilElma - 04.05.2021 01:55

I can't make border. It doesn't showing. Help me please. Thanks

Ответить
Otherworldly
Otherworldly - 22.02.2021 04:58

where do u get the white 1x1

Ответить
Jody Clemons
Jody Clemons - 20.02.2021 22:15

How do you attach the Mana bar to your Spells so when you shot a Spell it uses some of Mana bar ?

Ответить
KEMAL TÜRK
KEMAL TÜRK - 15.02.2021 18:37

This is not for beginners but thank you anyways :)

Ответить
Bruno Decnop
Bruno Decnop - 04.11.2020 02:25

Man, You are going WAY too fast. Can't Follow up.

Ответить
Hamza Musani
Hamza Musani - 19.09.2020 19:14

Question. I have made the mana system as shown and it works. I also made a dash system in another script ,from the movement tutorial. Now I want the player to dash only when there is enough mana but I cannot come up with a solution. Pls help

Ответить
Morgan Surname
Morgan Surname - 03.09.2020 15:02

Terrible tutorial. No idea why you'd need to speed certain sections up so quickly. Really makes the tutorial much harder to follow. We have the option to speed to video up ourselves.

Ответить
Madi Karl Ov
Madi Karl Ov - 16.07.2020 16:53

Thanks a lot, it helped!

Ответить
Mohammed Qamar
Mohammed Qamar - 02.07.2020 05:57

If your edgerect is moving in the wrong direction, just add a - before your fill amount ( -barImage.fillAmount)

Ответить
Random Coffee Cup
Random Coffee Cup - 21.06.2020 13:38

What is the mana?

Ответить
Arthur Cousseau
Arthur Cousseau - 07.06.2020 23:25

This is the ultimate tutorial!
Worked with Unity for 5 years and still learned a thing with RawImage UV Rect and using ImageType.Filled Horizontal instead of using a Slider.
Great tips!!

Ответить
Lionel Wylde
Lionel Wylde - 27.05.2020 07:33

pls help how do i call the tryspendmana function from a key, like
if(Input.GetKeyDown(KeyCode.T)){
mana.TrySpendMana(30);
}
that is my exact code, yet it does not show up that i used any. =[[[[

Ответить
ZorrroUK
ZorrroUK - 14.05.2020 13:25

Good lord, after 5 different energy/ health bar tutorials I have found one that works for me and looks good too

Ответить