Tween didnt work with aspectratio (UIConstant) Or I did anything wrong?

so im making a health bar system which I said in last post. But now with autoscale, the ui gone wrong, when i scale the Y of the gui, it auto scale the X, just like pressing Shift when editing :frowning:

image

But when i change the AspectRatio up, the bar got scaled smaller (sorry i suck at english)

so i changed the tween size to the script:

AspectRatio = 1 / formula

the health works, but when i do the tween, it wont work in anyway

If u can help the number goes to 1 / formula smoothly then thank you :heart:

2 Likes

I am having trouble understanding the issue here. If all you need is a smooth tween, then why are you not using TweenService?

local TweenService = game:GetService("TweenService")
local TWEEN_INFO = TweenInfo.new()

local function ChangeHealth()
    -- ...

    TweenService:Create(container.UIAspectRatioConstraint, TWEEN_INFO, {AspectRatio = 1 / formula}):Play()
end
3 Likes