How can i make a "bar" linked to a value?

  1. What do you want to achieve?
    Hello, how can i make a bar linked to a value, let me explain.

(The redsquare is the indicator and the white bar is the bar)

How can i make the indicator tween more and more to the right if the value is going and and more and more to the left if it’s going down?

  1. What is the issue?
    I can’t manage to do it.

  2. What solutions have you tried so far?
    I tried myself and looked on forums.

1 Like

You could find out by using AbsolutePosition and AbsoluteSize

local function GetPositionRelativeToFrame(pos : UDim2, frame : Frame)
	return UDim2.fromScale((pos.X.Offset-frame.AbsolutePosition.X)/frame.AbsoluteSize.X, (pos.Y.Offset-frame.AbsolutePosition.Y)/frame.AbsoluteSize.Y)

And it doesnt matter where its parented since it uses AbsolutePosition and size

1 Like