Assigning 2 values with 1 variables leaves some values unused

  1. What do you want to achieve?
    Im trying to Resize a TextButton when the player hovers their mouse over it.

  2. What is the issue?
    I receive an orange underline under the two lines of code below with the message “Assigning 2 values with 1 variables leaves some values unused”.

HoverEffect.Size = {0.20, 0},{0.08, 0}

and

HoverEffect.Size = {0.11, 0},{0.04, 0}
  1. What solutions have you tried so far?
    I couldnt find any solutions to my problem

Full block of code if needed.

local function Hover(HoverEffect)
	local originalPosition = HoverEffect.Position
	HoverEffect.MouseEnter:Connect(function()
		workspace.Hover.Playing = true
		HoverEffect:TweenPosition((originalPosition + UDim2.new(.015, 0, 0, 0)), "Out", "Sine", .1, true) 
		HoverEffect.BackgroundTransparency = 0.6
		HoverEffect.Size = {0.20, 0},{0.08, 0}
	end)
	HoverEffect.MouseLeave:Connect(function()
		HoverEffect:TweenPosition((originalPosition), "Out", "Sine", .1, true)
		HoverEffect.BackgroundTransparency = 1
		HoverEffect.Size = {0.11, 0},{0.04, 0}
	end)
end

HoverEffect, being a GuiObject,has a Size property that uses UDim2 datatype just like the Position property, use UDim2.new to assign the value to property properly:

HoverEffect.Size = UDim2.new(0.20, 0, 0.08, 0)
1 Like