Overhead not updating health bar?

Whenever I take damage it is not updating the offset of the gradient in the health bar

local function CharacterAdded(Character: Model)
	local Player = Players:GetPlayerFromCharacter(Character)
	
	if Player then
		local Root: BasePart = Character:WaitForChild('HumanoidRootPart')
		local Humanoid: Humanoid = Character:WaitForChild('Humanoid')
		
		Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
		
		if Overheads:FindFirstChild(Player.Name) then
			local _Overhead = Overheads:FindFirstChild(Player.Name)
			
			_Overhead.Adornee = Root
		else
			local Util = shared.Util
			local Adjuster = Util('StrokeAdjust')
			
			local _Overhead = Overhead:Clone()
			_Overhead.Name = Player.Name
			_Overhead.Parent = Overheads
			_Overhead.Adornee = Root
			
			local Frame = _Overhead.Frame
			local User = Frame.User
			
			if Player.DisplayName == Player.Name then
				User.Text = Player.Name
			else
				User.Text = string.format('%s(@%s)', Player.DisplayName, Player.Name)
			end
			
			Adjuster:TagBillboardGui(_Overhead)
		end
		
		local HealthChanged = Humanoid.Changed:Connect(function()
			local Health = Humanoid.Health
			
			local _Overhead = Overheads:FindFirstChild(Player.Name)
			
			if _Overhead then
				local Frame = Overhead.Frame
				local _Health = Frame.Health
				local Bar = _Health.Bar
				local Gradient = Bar.Gradient
				
				local Percent = Health / Humanoid.MaxHealth
				
				Gradient.Offset = Vector2.new(Percent, 0)
			end
		end)
		
		Humanoid.Died:Once(function()
			HealthChanged:Disconnect()
		end)
		
	end
end

Try using :GetPropertyChangedSignal() with the value you want and maybe you can add it not in the current function but outside. Else if that does not work try with a task.spawn(), hope this helps @ossuarys !

I have tried using GetPropertyChangedSignal, and my code already uses task.spawn for the modules, which this is apart of a module

Humanoid.HealthChanged instead of Humanoid.Changed

Still doesn’t change the offset

instead of vector 2 use udim and change the offset

Unable to assign property Offset. Vector2 expected, got UDim

well you dont set the offset through a udim, you set the size (i think)

mb i just read my reply again, sorry i cant really help, but im pretty sure it was something with udim

Use UDim2 maybe that will work.

Offset of a UIGradient takes a Vector2 not a UDim2 value

Sorry, so you’re having trouble with a UIGradient?

Can you show an example, like a screenshot?