GuiInputChanged

Constructor:

GuiInputChanged(inputobject,bool)

Description

This event is triggered when the user input changes.

Parameters

Name Type Description
inputobject RWObject Input object

Examples

Add the following client script under ClientfirstLogic. Start the game, and touch on the mobile phone to change the input state. Observe whether the event is triggered or not.

wait(1)
local uipanel = RWObject.Create("UiPanel") -- create a UiPanel
local uibtn = RWObject.Create("UiButton") -- create a UiButton
uibtn.Parent = uipanel -- set the parent of the created UiButton to the new created UiPanel
local person = Players:GetLocalPlayer() -- retrieve the player
uipanel.Parent = person. GameUI -- Set the parent of the UiPanel as GameUI
uibtn.GuiInputChanged:Connect(function(inputobject) -- the event of input changing is triggered on the UiButton
    print("The input changed")
    print(tostring(inputobject.UserInputType))-- print the input type
    print(tostring(inputobject.UserInputState)) -- print the input state    
end)