Hi again,
I've been stumped on this for quite a while but now that I found scriptinghelpers I really hope you guys could help me out on this :)
Basically, I am trying to get input from when the user interacts with a BillboardGui
object. (more specifically the frames inside of the gui). My issue seems to be that the GuiObject
events aren't triggering at all.
According to the wiki, every GuiObject instance has an event "InputBegan", which is fired when the user interacts with the GuiObject
using a mouse, touch, keyboard, etc. My goal is for the ui element to be able to read user keyboard inputs, but it seems that no matter what input I do the event doesn't fire.
I've set up a LocalScript
as shown in this image, and tested to make sure that the script is running by executing a print statement, and it did in fact run.
I've set up a couple of event connections to see if maybe it was just the InputBegan
event, but it's replicated for every event.
Here is my local script code:
01 | local frame = script.Parent |
03 | print ( "Hello from " .. frame.Name .. "! The LocalScript is running!" ) |
07 | frame.InputBegan:Connect( function (input) |
08 | print ( "input began! " .. tostring (input)) |
12 | frame.MouseMoved:Connect( function (x, y) |
13 | print ( "mouse moved, x: " .. x .. " y: " .. y) |
I've also tried setting up a LocalScript
inside StarterPlayerScripts
, then actively search for the ui element and run the exact same code, but I am left with identical results.
In addition to this, I've tried setting up a Script
object inside with identical content, but I net the same result as I did previously.
I understand that ContextActionService
can allow me to use the InputBegan
event as well, but it would really be a huge help if I were able to receive inputs only when the user interacts with the gui.
I can't seem to identify the problem here, I hope you guys can help me out on this! :)