This is the script:
local t = game:GetService("TweenService") local goal = {} goal.Size = UDim2.new({0, 182},{0, 64}) local m = t:Create(script.Parent, TweenInfo.new(2), goal) local goal1 = {} goal1.Size = UDim2.new({0, 188},{0, 50}) local m1 = t:Create(script.Parent, TweenInfo.new(2), goal1) script.Parent.MouseEnter:Connect(function() m:Play() end) script.Parent.MouseLeave:Connect(function() m:Pause() m1:Play() end)
But it gets so smaller. Please help?
The original size is {0, 188},{0, 50}
When you create the UDim2 your doing it wrong. I know in the properties editor it shows the format like ({x,x1},{y,y1}) but in a script it should be like this UDim2.new(x,x1,y,y1) My guess for why its getting smallers is because its taking only the first numbers which you entered as 0. To fix it don't put in the swirly brackets. Do it like this:
local t = game:GetService("TweenService") local goal = {} goal.Size = UDim2.new(0, 182,0, 64) local m = t:Create(script.Parent, TweenInfo.new(2), goal) local goal1 = {} goal1.Size = UDim2.new(0, 188,0, 50) local m1 = t:Create(script.Parent, TweenInfo.new(2), goal1) script.Parent.MouseEnter:Connect(function() m:Play() end) script.Parent.MouseLeave:Connect(function() m:Pause() m1:Play() end)
I had this problem too before I realized. I feel like a lot of people have this problem and roblox should really change the property editor so people don't make this mistake. Hope this helps.