Impara
Classe motore
GamepadService
Non costruibile
Assistenza
Non Replicato

*Questo contenuto è tradotto usando AI (Beta) e potrebbe contenere errori. Per visualizzare questa pagina in inglese, clicca qui.


Sommario
Membri ereditati

Riferimento API
Proprietà
GamepadCursorEnabled
Sicurezza Script Roblox
Lettura Parallela
Capacità: Input
GamepadService.GamepadCursorEnabled:boolean
Campioni di codice
GamepadService - Proprietà Abilitata del Cursore del Gamepad
local gamepadService = game.GamepadService
gamepadService:GetPropertyChangedSignal("GamepadCursorEnabled"):Connect(function()
local enabled = gamepadService.GamepadCursorEnabled
if enabled then
-- Codice personalizzato quando il cursore virtuale è abilitato
else
-- Codice personalizzato quando il cursore virtuale è disabilitato
end
end)

Metodi
DisableGamepadCursor
Capacità: Input
GamepadService:DisableGamepadCursor():()
Restituzioni
()
Campioni di codice
GamepadService - Disabilita il cursore del gamepad
local gamepadService = game.GamepadService
local userInputService = game.UserInputService
userInputService.InputBegan:Connect(function(inputObject, gameProcessed)
if inputObject.KeyCode == Enum.KeyCode.ButtonB then
gamepadService:DisableGamepadCursor()
end
end)

EnableGamepadCursor
Capacità: Input
GamepadService:EnableGamepadCursor(guiObject:Instance):()
Parametri
guiObject:Instance
Restituzioni
()
Campioni di codice
GamepadService - Abilita il cursore del gamepad
local gamepadService = game.GamepadService
local userInputService = game.UserInputService
local startObject = script.Parent
userInputService.InputBegan:Connect(function(inputObject, gameProcessed)
if inputObject.KeyCode == Enum.KeyCode.ButtonA then
gamepadService:EnableGamepadCursor(startObject)
end
end)

© 2026 Roblox Corporation. Roblox, il logo Roblox e Powering Imagination sono tra i nostri marchi registrati e non registrati negli Stati Uniti. e altri paesi.