Hi!
I’m needing some help with the tweening or MouseEnter/Leave.
I’m trying to achieve that when the mouse leaves the “BackpackButton” it returns to the original size & pos, but, when it leaves, it just doesn’t returns to the original pos & size, this only happens when the mouse passes by the button really fast.
local BackpackButton = script.Parent
local Banner = BackpackButton.Parent
local TitleLabel = Banner.TitleLabel
local QuickButtons = Banner.Parent
local PlayerHud = QuickButtons.Parent
local BackpackUI = PlayerHud.BackpackUI
local MouseOverModule = require(game.ReplicatedStorage.MouseOverModule)
local MouseEnter, MouseLeave = MouseOverModule.MouseEnterLeaveEvent(BackpackButton)
MouseEnter:Connect(function()
Banner:TweenPosition(UDim2.fromScale(-0.007, 0.212), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.09)
BackpackButton:TweenSize(UDim2.fromOffset(140, 140), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.09)
TitleLabel.Visible = true
MouseLeave:Connect(function()
Banner:TweenPosition(UDim2.fromScale(-0.007, 0.342), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.09)
BackpackButton:TweenSize(UDim2.fromOffset(128, 128), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.09)
TitleLabel.Visible = false
end)
end)
BackpackButton.MouseButton1Click:Connect(function()
if BackpackUI.Visible == false then
BackpackUI.Visible = true
BackpackButton.ImageTransparency = 0.6
else
BackpackUI.Visible = false
BackpackButton.ImageTransparency = 0
end
end)
Example Video: