Pro_JC
|
  |
| Joined: 08 Jul 2011 |
| Total Posts: 2701 |
|
|
| 21 Jun 2017 05:23 PM |
When my mouse enters, it works fine, but not when my mouse leaves the ImageLabel. It also works in Studio, but no in-game. And yes, I am using a local script.
script.Parent.MouseEnter:connect(function() script.Parent.Visible = false script.Parent.Parent.StartMenuButtonGlow.Visible = true end)
script.Parent.Parent.StartMenuButtonGlow.MouseLeave:connect(function() script.Parent.Visible = true script.Parent.Parent.StartMenuButtonGlow.Visible = false end)
Pineapples do not belong on Pizza |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2017 05:32 PM |
| Test it in studio by going to the test tab ontop and clicking 'Start' or something like that. Then test it and check the output. |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2017 05:39 PM |
I use MouseEnter and MouseLeave all the time in local scripts are it works fine for me.
The only difference is that when I do it I would write it like this:
function onEnter() script.Parent.Visible = false script.Parent.Parent.StartMenuButtonGlow.Visible = true end script.Parent.MouseEnter:connect(onEnter)
function onLeave() script.Parent.Visible = true script.Parent.Parent.StartMenuButtonGlow.Visible = false end script.Parent.MouseLeave:connect(onLeave)
I only use that type of function to call other functions.
|
|
|
| Report Abuse |
|
|
Pro_JC
|
  |
| Joined: 08 Jul 2011 |
| Total Posts: 2701 |
|
|
| 21 Jun 2017 05:40 PM |
There is no problem being stated in the output. The MouseEnter/Leave works wonderfully in studio. Sadly not in-game. :/
Pineapples do not belong on Pizza |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2017 05:43 PM |
Try the way I wrote it.
It usually works for me.
If not IDK what is wrong.
But also, sometimes using MouseLeave glitches if you move your mouse off the GUI too quickly.
Idk if it is just me or not.
|
|
|
| Report Abuse |
|
|
|
| 21 Jun 2017 05:45 PM |
| I think the problem is that you didn't set a MouseEnter function for StartMenuButtonGlow, only MouseLeave. I'm not sure that works. |
|
|
| Report Abuse |
|
|
Pro_JC
|
  |
| Joined: 08 Jul 2011 |
| Total Posts: 2701 |
|
|
| 21 Jun 2017 05:47 PM |
@ LeRiceFarmer
I have tried. It won't work in studio anymore.
So I am gonna create a different way for it to function.
Pineapples do not belong on Pizza |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2017 06:59 PM |
That's weird, ill look at some of my GUI's with that and see what the coding is
|
|
|
| Report Abuse |
|
|
|
| 21 Jun 2017 07:07 PM |
Yeah I think its the coding inside the function, nothing is wrong with MouseEnter/MouseLeave
|
|
|
| Report Abuse |
|
|