I’m trying to make some cards go up when a mouse enters them and go down when a mouse leaves them. Though due to what I assume is the fault of unreliable mouse leave, the cards sometimes “lag” and stay in place even when mouse leave is triggered.
At first I looked this issue up and found a dev forum post about it. I tried one of the fixes mentioned, which is to wait a frame after mouse enter or mouse leave is triggered, which didn’t work, Then I tried using a module which should have fixed said issue, but alas it did not work.
Any kind of help will be greatly appreciated
Here’s the code:
also the reason I added an if statement for looking is to stop the player from selecting multiple cards at the same time, even when said cards were behind each other
local OldPos = CardC.Position
CardC.MouseEnter:Connect(function()
if Looking == false then
Looking = true
CardC.ZIndex+=1
Tween(CardC,TweenInfo.new(0.05),{Position =OldPos+UDim2.new(0,0,0,-40)})
end
end)
CardC.MouseLeave:Connect(function()
if Looking == true then
Looking = false
CardC.ZIndex-=1
Tween(CardC,TweenInfo.new(0.05),{Position =OldPos })
end
end)