I should enlarge the "object" by 20 pixels when the mouse is on it. When the mouse leaves the object, it should return to its original length. The problem now is that if I move the mouse out of the object while it is being enlarged, it stays at this size and no longer shrinks to its original size.
This is my code:
local object = script.Parent object.MouseEnter:Connect(function(x,y) object:TweenSize(UDim2.new(0, 120, 0, 100)) end) object.MouseLeave:Connect(function(x,y) object:TweenSize(UDim2.new(0, 100, 0, 100)) end)
You forgot toset EasingStyle and Direction. Try this:
local object = script.Parent object.MouseEnter:Connect(function(x,y) object:TweenSize(UDim2.new(0, 120, 0, 100), 'In', 'Linear',1, true) end) object.MouseLeave:Connect(function(x,y) object:TweenSize(UDim2.new(0, 100, 0, 100), 'In', 'Linear', 1, true) end)