Gui Scaling Scripting Help

Basically my code:

local frame = script.Parent

local startPosition = Vector2.new(0.007, 0)
local startSize = Vector2.new(0.002, 0)

local endPosition = Vector2.new(0.501, 0)
local endSize = Vector2.new(0.625, 0)

local function moveBar()
	local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Linear)
	local tween = game:GetService("TweenService"):Create(frame.MainBar, tweenInfo, {Position = UDim2.new(endPosition.X, endPosition.Y)})
	tween:Play()
end

local function sizeBar()
	local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Linear)
	local tween = game:GetService("TweenService"):Create(frame.MainBar, tweenInfo, {Size = UDim2.new(endSize.X, endSize.Y)})
	tween:Play()
end

frame.MainBar.Position = UDim2.new(startPosition.X, startPosition.Y)
frame.MainBar.Size = UDim2.new(startSize.X, startSize.Y)

moveBar()
sizeBar()

Is moving the bar from left to the center and scales it down. I want to be fixed on the left and move gradually to the right until the end position and scaling is met.

Could you elaborate and specify the error with details? I believe this is too vague for me to find the problem.

1 Like

I have already figured out why, thanks for your effort!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.