For better context on the video, this is an bug that happens when the player leaves the button quickly and would go down, I find this odd as MouseEnter isn’t affected by this.
I’ve looked at previous devforums about this issue but neither do any of them have the same issue as I, I could be wrong and can be a scripting error I made some where.
I’ve tried tweaking the adding and subtraction on MouseEnter and MouseLeave they might be the issue but not quite sure.
for i, button in pairs(script.Parent:GetDescendants()) do
if button:IsA("ImageButton") then
button.MouseButton1Up:Connect(function()
if button:FindFirstChild("mapName") then
local remote = game:GetService("ReplicatedStorage"):WaitForChild("OnMapSelection")
remote:FireServer(button:FindFirstChild("mapName").Text)
else
warn("Map title not found.")
return
end
end)
-- mouse functions
button.MouseEnter:Connect(function()
tweenService:Create(button, TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {Position = UDim2.new(button.Position.X.Scale, button.Position.X.Offset, button.Position.Y.Scale - 0.05)}):Play()
end)
button.MouseLeave:Connect(function()
tweenService:Create(button, TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {Position = UDim2.new(button.Position.X.Scale, button.Position.X.Offset, button.Position.Y.Scale + 0.05)}):Play()
end)
end
end