Powerbar problem

Hello there. First of all happy sunday to everyone…
So for the past 2 months I have been making endless jumping game and its almost finished. Its lacking powerbar… I have managed to make one but it does not scale with the screen change… I tryied to use canvas to world screen but bar won’t face the direction you click… So like the longer you hold left mouse click, more power it has and it faces the direction you click… Atleast it should do that, and i does but only on one screen size.
It looks likes this:

So this is the code i am currently using…

#pragma strict
var target : Vector3;
var bar_back : UnityEngine.UI.Image;
var powerFill : GameObject;
var powerFill_Image : UnityEngine.UI.Image;
var powerFill_startPos;
var powerFillAccel : float;

function Start ()
{
    powerFill_startPos = powerFill.transform.localPosition.x;
    powerFillAccel = 770 * Time.deltaTime;
}

function Update ()
{
    if(Input.GetMouseButton(0) && collision.onPlatform == true && delete.jurinoFlag == true)
    {
        bar_back.enabled = true;
        powerFill_Image.enabled = true;
        var moveDirection : Vector3 = gameObject.transform.position - Input.mousePosition;
        if (moveDirection != Vector3.zero)
        {
            var angle : float = Mathf.Atan2(moveDirection.y, moveDirection.x) * Mathf.Rad2Deg;
            angle -= 180;
            transform.rotation = Quaternion.AngleAxis(angle, Vector3.forward);
        }
        powerFill.transform.localPosition.x += powerFillAccel;
    }
    else
    {
        bar_back.enabled = false;
        powerFill.transform.localPosition.x = powerFill_startPos;
        powerFill_Image.enabled = false;   
    }
}

I would very much appreciate any help i can get so i can finish the game and publish it :slight_smile:
Thanks for taking time and replying. Have a nice day!

bump bump :smile: ?