How to set a part's position every heartbeat while tweening its Y position?

The title says it all. How do i set a part’s position every heartbeat while tweening its Y position?
Here’s a barebones version of my code:

local Part = workspace.Part
runService.Heartbeat:Connect(function()
   Part.Position = Vector3.new(root.Position.X, Part.Position.Y, root.Position.Z)
end)

local info = TweenInfo.new(2)
local goal = {Position = Vector3.new(root.Position.X, Part.Position.Y + 15, root.Position.Z))}
local tweenUp = tweenService:Create(Part, info, goal)
tweenUp:Play()
1 Like