UDim2.new() rounding to 1

I’m making a health bar that divides the character Health by MaxHealth, and the calculation result is correct, but after use the result in UDim2.new(), the value return anything like {1, 0}, {0.5, 0}.

script.Parent.hptxt.Text = HP
script.Parent.maxHp.Text = MaxHP
			
local calc = HP / MaxHP
local Bar = script.Parent.LifeBar.Bar
Bar.Position = UDim2.fromScale(0.504 * calc, 0.5)
Bar.Size = UDim2.fromScale(0.992 * calc, 0.72)

I discover the problem, there’s a another part of script making a interference.

oh well, we could’ve always helped you lol