|
| 18 Jun 2014 03:57 PM |
I have been stumped as to why I can not get MouseEnter to work properly. I have tried it several different ways and my GUI objects are set to active, yet nothing seems to work.
_G.start.MouseEnter:connect(function() print("Hovered"); end)
_G.start being declared as a global variable that points to my GUI object.
I have also tried this:
function Enter() print("Hovered"); end
_G.start.MouseEnter:connect(Enter)
I have done this before in another game, and the scripts are strikingly similar. It just doesn't want to work in this one though.
Any ideas?
Thank you |
|
|
| Report Abuse |
|
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 18 Jun 2014 03:58 PM |
Why do you need to make a function global? Anyways, you're setting the Global setting to an event, not a variable.
_G.Enter = function() print("Hovered"); end
start.MouseEnter:connect(_G.Enter) |
|
|
| Report Abuse |
|
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 18 Jun 2014 03:59 PM |
| Oh sorry I didn't read that right. I'll look into it. |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2014 04:29 PM |
| Yeah, for this case, I'm not needing a global function. Just trying to figure as to why it doesn't trigger the event. I was doubting that it was my code before, but I began to wonder after not getting it to work for an entire day. As said though my GUI objects are set to active, so it should be able to see it when placing the mouse on the object. |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 18 Jun 2014 04:39 PM |
Tell us how you defined _G.start |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2014 04:51 PM |
_G.start = _G.menuGUI.start;
menuGUI just being a screenGUI in the player's GUI. _G.start is just a textbutton in menuGUI(ScreenGui) |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2014 06:44 PM |
| Still having issues with this, unfortunately. |
|
|
| Report Abuse |
|
|