I'm learning about Gamepad inputs. The following code is supposed to get the available KeyCodes for the Gamepad2. I do not understand what is happening in lines 3-4. Please explain what these lines do.
local availableInputs = game:GetService("UserInputService"):GetSupportedGamepadKeyCodes(Enum.UserInputType.Gamepad2) print("This controller supports the following controls:") for _, control in pairs(availableInputs) do print(control) end
for _, control in pairs(availableInputs) do print(control) end
What this line does in your code above is that it essentially checks your controller for what controls it has because roblox does not only support xbox one controllers but other controllers can be used to play roblox as well so its needed to check what inputs the controller that the player is using has.