Animated Healthbar

Hi community !

I’m new to Unity and i would like to make an orb healthbar animated like it’s does in Diablo 3 :

I have my animation of orb healthbar make with Cinema 4D (see attachement, 2 pictures of animation)


So, i know how to make an healthbar ok, but not animated healthbar, maybe load .jpeg sequence, don’t know what technique must be use for it…i need your help
thank you for your reply !

Best regards

I would try using a 2D mesh with bone animation to achieve the sloshing effect (more efficient than an image sequence) and a shader that employes some UV scrolling to make the blood look like its swirling. The glass orb would be on a second quad laid over the top of the blood.

Hi Dynast79,

It’s an old post but did you find a solution ? I’m trying to make something in the same way :

A vertical glass time bar with fluid in it. I use the UI 4.6 system with the fill amount for the time bar (works great by the way) but I don’t have a clue to find a proper way to make the sprite animation on the top of the liquid (small waves) following the top position of the image…

Hope I’m clear enough and somebody here is better than me to simulate that :slight_smile:

Thank you

For example:

using UnityEngine;
 
public class animatedGUI : MonoBehaviour {
 
    public Texture2D[] textures;
    public float velocity = 1f;
    public Rect rect;
 
    float frame = 0f;
 
    // Use this for initialization
    void Start () { if(this.textures.Length==0) Destroy(this); }
  
    // Update is called once per frame
    void Update(){
 
        this.frame = Mathf.Repeat(this.frame+this.velocity * Time.deltaTime,this.textures.Length);
  
    }
 
    void OnGUI(){
 
        GUI.DrawTexture(this.rect, this.textures[(int)this.frame]);
 
    }
 
}