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

The MouseEnter and MouseLeave Events are glitching out?

I have a button that is very glitchy on the MouseEnter Event. What do i mean by glitchy? Well, Sometimes the events do not fire and nothing happens occasionally. Please Explain to me why it is glitchy and any ideas to fix it. Theres NO Output nor error.

local Image = script.Parent.Parent
local Text = script.Parent
local Detector = script.Parent.Detector

Detector.MouseEnter:connect(function()
Image:TweenPosition(UDim2.new(.01,0,.45), "Out", "Quad", .2)
Detector.Size = UDim2.new(Text.Size.X.Scale*2,0,1)
Detector.Position = UDim2.new(-1)
end)

Detector.MouseLeave:connect(function()
Image:TweenPosition(UDim2.new(0,0,.45), "Out", "Quad", .2)
Detector.Size = UDim2.new(Text.Size.X.Scale/2,0,1)
Detector.Position = UDim2.new(0)
end)

1 answer

Well, a problem is your trying to define something that is not tuere. For example if I put my mouse of a button that says "GO TRAIN" I can change that like MouseEnter:connect(function() And define what you want your text to change to.

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