Moba Styled Health Bar Divisions

I am trying to get a Moba styled health bar, as in if I have 1000hp there should be 9 lines
like this: 100hp|100hp|100hp|100hp|100hp|100hp|100hp|100hp|100hp|100hp
And if I have 2000hp I should have 19 lines, and so on and so forth.
Here is my code, I am having trouble:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerHealth : MonoBehaviour {
    
    public int MaxHealth = 100;
    public int CurrentHealth = 0;
    public int BarWidth = 50;

    void Awake() {
        CurrentHealth = MaxHealth;
    }

    void Update() {
        float pixelsPerHP = (float)BarWidth / MaxHealth;//~0.6f
        int everyHundredHPLineOffset = Mathf.RoundToInt(pixelsPerHP * 100);//~60

        int numberOfLines = Mathf.RoundToInt((float)MaxHealth / 100);
        for (int i = 1; i < numberOfLines + 1; i++) {
            int offset_current = i * everyHundredHPLineOffset;
            //Draw line using offset_current
        }
    }
}

But I don’t know how to draw the line. :frowning:
Does anyone know? Please help me. Thanks!

Where are you trying to draw this line? Something tells that you probably should be using GUI. If you are you actually need to create an image of a line next to the image of the health.

But you really should be using GUI for this…

Try a horizontal Layout, and for each 100hp, instantiate one new. Then for the lenght of the array of vars, divide it for the total lenght of the bar, and set that value to the scale of ehvery bar(of 100 hp)