Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --//Services
- local tweenService = game:GetService("TweenService")
- --//Variables
- local ui = script.Parent
- local originalSize = ui.Size
- local originalPosition = ui.Position
- local hoverSizeIncrease = UDim2.new(0.01, 0, 0.01, 0)
- local hoverSize = originalSize + hoverSizeIncrease
- local hoverPosition = originalPosition - UDim2.new(hoverSizeIncrease.X.Scale / 2, 0, hoverSizeIncrease.Y.Scale / 2, 0)
- local tweenTime = 0.2
- --//Tweens
- local hoverTween = tweenService:Create(ui, TweenInfo.new(tweenTime), {Size = hoverSize, Position = hoverPosition})
- local leaveTween = tweenService:Create(ui, TweenInfo.new(tweenTime), {Size = originalSize, Position = originalPosition})
- ui.MouseEnter:Connect(function()
- hoverTween:Play()
- end)
- ui.MouseLeave:Connect(function()
- leaveTween:Play()
- end)
Advertisement
Add Comment
Please, Sign In to add comment