Putting this here because the issues only started happening when I added the code for the tween - thinking I just don’t understand something.
The very first time this tween is called to act, it makes the health bar an odd size.
However, when the mouse is no longer targeting something, then finds a new target, everything behaves normally.
Here are the default properties of the progress bar being changed:
And this is the code actually doing the changes:
local function LTweenSize(Frame, EndSize, Duration)
Duration = Duration or .1
Frame:TweenSize(
EndSize,
Enum.EasingDirection.InOut,
Enum.EasingStyle.Linear, Duration, true)
end
local function UpdateHealthGauge(target)
bottom.Visible = true
targetName.Text = target.Type.Value
hpBar.Text = target.Health.Value.."/"..target.MaxHealth.Value
LTweenSize(Barback, UDim2.fromScale(target.Health.Value/target.MaxHealth.Value, .63), .1)
end
Am I doing something incorrectly? Is it because my size uses offsets but the UDim2 is from scale (tbh I really don’t understand UDim2 very well).