Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I detect if a players mouse is still hovering over an object?

script.Parent.MouseEnter:Connect(function() local frame = script.Parent.Parent.Label frame:TweenPosition(UDim2.new(0.045, 0,0.476, 0), 'Out', 'Quart', 1)

	script.Parent.MouseLeave:Connect(function()
		frame:TweenPosition(UDim2.new(-0.1, 0,0.476, 0), 'Out', 'Quart', 1)
end)

end)

I'm trying to make it so when A player hovers over a gui it tells them what it is but if their mouse enters and leaves too quickly the gui gets stuck there

2 comments

0

Try adding ,true to your TweenPosition like so, frame:TweenPosition(UDim2.new(-0.1, 0,0.476, 0), 'Out', 'Quart', 1, true)

0

Setting the value to true (Its called the override parameter) makes it so that the TweenPosition is able to go into affect even if its already being tweened by another script

1 answer

You have two options here. Either make a debounce so that it cannot be spammed which means it will not get stuck or as WizyTheNinja said add the True value so that it will Tween even if its already being Tweened,

This discussion is preserved as it was. New answers, comments, and votes are closed.