Roblox Game Development

Detecting Gamepads

2022-02-09  本文已影响0人  jaycex2020

Detecting Gamepads

local UserInputService = game:GetService("UserInputService")

if UserInputService.GamepadEnabled then

    print("Player has gamepad enabled...")

end

local UserInputService = game:GetService("UserInputService")

UserInputService.GamepadConnected:Connect(function(gamepad)

print("Player has connected controller: " .. tostring(gamepad))

end)

UserInputService.GamepadDisconnected:Connect(function(gamepad)

print("Player has disconnected controller: " .. tostring(gamepad))

end)

上一篇 下一篇

猜你喜欢

热点阅读