Why is Loop stacking tween positions?

I making a farming system, and when this loop runs each time it tweens the scale and position.

The stages after the first get like stacked ontop of one anothers collision and CanCollide is off.

Any help is appreciated, Thanks!

while not Crop_Empty and Crop_Stage ~= Max_Stages do
    local Crop_Folder = Farm_Slot.Crop_Type:WaitForChild(Crop_Type)
    
    for _, Part in pairs(Crop_Folder:GetChildren()) do    
        Part.Transparency = 1
    end
    
    Crop_Stage = Crop_Stage + 1
    print("worked")
    
    local Visible_Stage = Crop_Folder:WaitForChild(Crop_Type.."_"..Crop_Stage)
    Visible_Stage.Transparency = 0
    
    local initialSize = Vector3.new(Visible_Stage.Size.X, 0, Visible_Stage.Size.Z)
    local targetSize = Visible_Stage.Size

    -- Initial position
    local initialPos = Visible_Stage.Position
    -- Target position (same X and Z, new Y)
    local targetPos = initialPos + Vector3.new(0, targetSize.Y / 2, 0)

    -- Set initial size only once
    Visible_Stage.Size = initialSize

    -- Create tween
    local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
    local tweenProperties = {
        Size = targetSize,
        Position = targetPos
    }
    local tween = TweenService:Create(Visible_Stage, tweenInfo, tweenProperties)

    -- Play tween
    tween:Play()

    -- Wait for tween to complete
    tween.Completed:Wait()
    
    wait(5 * Grow_Time * Crop_Stage)
end

1 Like