Can I get a rigidbody's velocity and convert it to a fill value of an image?

I am currently in the midst of trying to create what would essentially be the equivalent to a Vertical Speed Indicator. I have two images created separately that meet in the middle and fill in the opposite direction. And I am trying to find/create a code for example that would scale the fill image as the gameobject goes forward/backwards & up/down.

The problem I’m running in to is while I know how to set the fill image based on a certain velocity
ex. ‘if (playerRb.velocity.y = 5) indicatorUp.fillValue = .25;’ obviously that isn’t actually taking the velocity and applying it.

You’ll probably need a max velocity value. Let’s say you make the velocity fill a bar ( Like a health bar in a game ). So you could do something like this

    private void Update()
    {
        Vector3 vel = GetComponent<Rigidbody>().velocity;
        Vector3 maxVel = new Vector3(10f, 10f, 10f);
        Image imageX;
        imageX.transform.localScale.x = vel.x / maxVel.x * parentImage.transform.localScale.x; 
    }

I didn’t test that and that probably wont work but it’s something along those lines. You set the scale of the image depending on the velocity. You add a max velocity so the bar doesn’t burst out of the parent. Max vel can be dynamic, just change it to watever you like during runtime as well. Did that help you?