U
U
Uncle Bogdan2021-10-08 10:59:49
Unity
Uncle Bogdan, 2021-10-08 10:59:49

How to make a health bar for a 3d object in Unity?

I found a video on how to make a billboard, but how to make a stripe? Like a strip in the stroke with a value from 0 to 1.

Like this:

615ff9d257635999906340.png

But for this thing to be like a billboard over the object.

How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
KraGen.Developer, 2021-10-08
@KraGenDeveloper

in general, place a Slider over the player and make a script that you throw it on the player and add such lines in the script

using Unity.Engine.UI;//это в самый верх 

public Slider HPslider;//сама полоска хп 
int HP = 100;//кол-во хп

public void Update(){
HPslider.value = HP;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question