Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

The MouseEnter and MouseLeave Events are glitching out?

Asked by
Zeloi 40
10 years ago

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

Log in to vote
0
Answered by 7 years ago

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.

Ad

Answer this question