I’m trying to make it so once the players mouse enters the frame, the frame tweens, but for some reason it isn’t working, although it’s printing the message.
Code:
local shopButton = script.Parent:WaitForChild("ShopButton") -- frame
local startsize = UDim2.new(script.Parent.Size.Width.Scale, 0, script.Parent.Size.Height.Scale, 0)
local hoversize = UDim2.new(script.Parent.Size.Width.Scale * 1.05, 0, script.Parent.Size.Height.Scale * 1.05, 0) --change 1.05 to whatever works for you
script.Parent.MouseEnter:Connect(function()
shopButton:TweenSize(hoversize,Enum.EasingDirection.Out,Enum.EasingStyle.Sine,.25,true)
print("mouse Enter") -- Printing that works but not tween
end)
script.Parent.MouseLeave:Connect(function()
shopButton:TweenSize(startsize,Enum.EasingDirection.Out,Enum.EasingStyle.Sine,.25,true)
end)
local shopButton = script.Parent:WaitForChild("ShopButton") -- frame
local startsize = UDim2.new(script.Parent.Size.Width.Scale, 0, script.Parent.Size.Height.Scale, 0)
local hoversize = UDim2.new(script.Parent.Size.Width.Scale * 1.05, 0, script.Parent.Size.Height.Scale * 1.05, 0) --change 1.05 to whatever works for you
shopButton.MouseEnter:Connect(function()
shopButton:TweenSize(hoversize,Enum.EasingDirection.Out,Enum.EasingStyle.Sine,.25,true)
print("mouse Enter") -- Printing that works but not tween
end)
shopButton.MouseLeave:Connect(function()
shopButton:TweenSize(startsize,Enum.EasingDirection.Out,Enum.EasingStyle.Sine,.25,true)
end)
Although it wouldnt tween the frame, when i parented it with the imageButton instead it tweened that, so I guess that will work. Thankyou for your help!