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

UserInputType only showing mouse movements?

Asked by
trecept 367 Moderation Voter
6 years ago
TextBox.InputBegan:Connect(function(input)
    print(tostring(input.UserInputType))
    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        -- my script goes here
    end
end)

I have a script inside this function where when I click on the textbox, some tweening is done on a GUI. However, I could not figure out what was going wrong when nothing was happening, so I decided to print all the input types occuring. All I saw was mouse movements though, and nothing when I clicked or used textinput (for text boxes). I tried InputChanged and the same thing happened. How do I detect when someone either clicks on the textbox or is focused on the textbox?

Answer this question